java interview questions
java interview questions
- What is finally and finalize in java?
- Can we declare a class as static?
- What is static import?
- What is try-with-resources in java?
- What is multi-catch block in java?
- What is static block?
- What is inner class in java?
- What is anonymous inner class?
- What is Classloader in Java?
- What are different types of classloaders?
- What is ternary operator in java?
- What does super keyword do?
- What is break and continue statement?
- What is this keyword?
- What is default constructor?
- What is Java Reflection API? Why it’s so important to have?
- What is composition in java?
- What is the benefit of Composition over Inheritance?
- How to sort a collection of custom Objects in Java?
- Can we have try without catch block?
- What is Garbage Collection?
- What is Serialization and Deserialization?
- How to run a JAR file through command prompt?
- What is the use of System class?
- What is instanceof keyword?
- Can we use String with switch case?
- What will be the output of following programs?
- What is meant by implicit objects and what are they ?
- What are Expressions ?
- What are Decalarations ?
- What is Function Overriding and Overloading in Java ?
- What is a Constructor, Constructor Overloading in Java and Copy-Constructor ?
- Does Java support multiple inheritance ?
- What is the difference between an Interface and an Abstract class ?
- What are pass by reference and pass by value ?
- What is the difference between processes and threads ?
- What is the importance of main method in Java?
- What is overloading and overriding in java?
- Can we overload main method?
- Can we have multiple public classes in a java source file?
- What is Java Package and which package is imported by default?
- What are access modifiers?
- What is final keyword?
- What is static keyword?
- What is an interface?
- What is an abstract class?
- What are JSP actions ?
- What are Directives ? What are the different types of Directives available in JSP ?
- What are the advantages of JSP ?
- What is the Difference between JDK and JRE ?
- What are Wrapper classes?
- What is Enum in Java?
- What is Java Annotations?
- What are Scriptlets ?
- What does the “static” keyword mean ? Can you override private or static method in Java ?
- What are the basic interfaces of Java Collections Framework ?
- Why Collection doesn’t extend Cloneable and Serializable interfaces ?
- What is an Iterator ?
- What differences exist between Iterator and ListIterator ?
- What is difference between fail-fast and fail-safe ?
- How HashMap works in Java ?
- What is the importance of hashCode() and equals() methods ?
- What differences exist between HashMap and Hashtable ?
- What are the important features of Java 8 release?
- What do you mean by platform independence of Java?
- What is JVM and is it platform independent?
- What is the difference between JDK and JVM?
- What is the difference between JVM and JRE?
- Which class is the superclass of all classes?
- Why Java doesn’t support multiple inheritance?
- Why Java is not pure Object Oriented language?
- What is difference between path and classpath variables?
- What is the difference between abstract class and interface?
- Can an interface implement or extend another interface?
- What is Marker interface?
- Can you access non static variable in static context ?
- What are the Data Types supported by Java ? What is Autoboxing and Unboxing ?
- Explain different ways of creating a thread. Which one would you prefer and why ?
- Explain the available thread states in a high-level.
- What is servlet chaining?
- What is a serverside include?
- What is meant by a web application?
- What is the difference between doget() and do post()?
- Explain the life cycle of a servelt?
- What is the difference between genericservlet and httservlet?
- What is the differce an applet and a servlet?
- Explain the architechture of a servlet
- What is a servlet?
- Explain serialization and deserilization
- Explain marshalling and demarshalling
- What is the applet class loader, and what does it provide ?
- What is the applet security manager, and what does it provide ?
- What is the difference between a Choice and a List ?
- What is a layout manager ?
- What is the difference between a Scrollbar and a JScrollPane ?
- Which Swing methods are thread-safe ?
- Name three Component subclasses that support painting.
- What is the purpose of using RIMS security manager in RMI?
- WhaT is DGC? And how does it work?
- what is the role of stub in RMI?
- What are the steps involved to make a RML pgrogramme?
- what is difference between using bind() and rebind()method of naming class?
- what is meant by binding in RMI?
- What is the role of the java.rmi.Naming Class?
- what is the role of Remote Interface in RMI?
- What are layers of RMI Architecture?
- what does connection pooling mean?
- whaat is the use CallableStatement?
- What is the desing pattern that Java uses for all swing components?
- what iadvantage do java’layout managers provide over traditional windowing systems?
- how can a GUI component handleits own events?
- What is the difference between an Applet and a Java Application ?
- What are the restrictions imposed on Java applets ?
- What are untrusted applets ?
- What is the difference between applets loaded over the internet and applets loaded via the file system ?
- What is clipping ?
- What is JVM ? Why is Java called the “Platform Independent Programming Language” ?
- What is the difference between a MenuItem and a CheckboxMenuItem ?
how are jsp requests handled? - what is a jsp page?
- what is url encoding and url decoding?
- what is difference between sendredirect and forward methods?
- what is http tunneling?
- which protocol will be used by browser and servlet to communicate?
- what is the strcute of the http reponsse?
- how do you find out what client machine is maing a rquest to your servlet?
- What is the difference between throw and throws ?
- What is the importance of finally block in exception handling ?
- What will happen to the Exception object after exception handling ?
- How does finally block differ from finalize() method ?
- What is an Applet ?
- Explain the life cycle of an Applet.
- What happens when an applet is loaded ?
- Name the method which is used to prepare a Callablestatement?
- What is the advantage of preparedStatement over Statement?
- Explain the role of driver in JDBC?
- What is JDBC?
- What is the difference between Exception and Error in java ?
- What is the relationship between an event listener interface and an event adapter class?
- What is the relationship between clipping and repainting?
- What is the difference between a Window and a Frame ?
- How are the elements of aGRIDBagLayout orgranized?
- How are the elements of border layout orgranized?
- What is the difference between Serial and Throughput Garbage collector ?
- When does an Object becomes eligible for Garbage collection in Java ?
- Does Garbage collection occur in permanent generation space in JVM ?
- What are the two types of Exceptions in Java ? Which are the differences between them ?
- What is the difference between HashSet and TreeSet ?
- What is the purpose of garbage collection in Java, and when is it used ?
- What does System.gc() and Runtime.gc() methods do ?
- When is the finalize() called ? What is the purpose of finalization ?
- If an object reference is set to null, will the Garbage Collector immediately free the memory held by that object ?
- What is structure of Java Heap ? What is Perm Gen space in Heap ?
- What is Java Priority Queue ?
- What’s the difference between Enumeration and Iterator interfaces
- what is difference between Array and ArrayList ? When will you use Array over ArrayList ?
- What is difference between ArrayList and LinkedList ?
- What is Comparable and Comparator interface ? List their differences.
- How does thread synchronization occurs inside a monitor ? What levels of synchronization can you apply ?
- What’s a deadlock ?
- How do you ensure that N threads can access N resources without deadlock ?
- What is the difference between a synchronized method and a synchronized block ?
- What do you know about the big-O notation and can you give some examples with respect to different data structures ?
- What is the tradeoff between using an unordered array versus an ordered array ?
- What are some of the best practices relating to the Java Collection framework ?