- Give a few reasons for using Java?
- What is the main difference between the Java platform and the other software platforms?
- What is the difference between C++ and Java?
- Explain Java class loaders? Explain dynamic class loading?
- What are the advantages of Object Oriented Programming Languages (OOPL)?
- How does the Object Oriented approach improve software development?
- How do you express an ‘is a’ relationship and a ‘has a’ relationship or explain inheritance and composition? What is the difference between composition and aggregation?
- What do you mean by polymorphism, inheritance, encapsulation, and dynamic binding?
- What is design by contract? Explain the assertion construct?
- What is the difference between an abstract class and an interface and when should you use them?
- Why there are some interfaces with no defined methods (i.e. marker interfaces) in Java?
- When is a method said to be overloaded and when is a method said to be overridden?
- What is the main difference between an ArrayList and a Vector? What is the main difference between Hashmap and Hashtable?
- Explain the Java Collection framework?
- What are some of the best practices relating to Java collection?
- When providing a user defined key class for storing objects in the Hashmaps or Hashtables, what methods do you have to provide or override (i.e. method overriding)?
- What is the main difference between a String and a StringBuffer class?
- What is the main difference between pass-by-reference and pass-by-value?
- What is serialization? How would you exclude a field of a class from serialization or what is a transient variable? What is the common use?
- Explain the Java I/O streaming concept and the use of the decorator design pattern in Java I/O?
- How can you improve Java I/O performance?
- What is the main difference between shallow cloning and deep cloning of objects?
- What is the difference between an instance variable and a static variable? Give an example where you might use a static variable?
- Give an example where you might use a static method?
- What are access modifiers?
- Where and how can you use a private constructor?
- What is a final modifier? Explain other Java modifiers?
- What is the difference between final, finally and finalize() in Java?
- How does Java allocate stack and heap memory? Explain re-entrant, recursive and idempotent methods/functions?
- Explain Outer and Inner classes (or Nested classes) in Java? When will you use an Inner Class?
- What is type casting? Explain up casting vs. down casting? When do you get ClassCastException?
- What do you know about the Java garbage collector? When does the garbage collection occur? Explain different types of references in Java?
- If you have a circular reference of objects, but you no longer reference it from an execution thread, will this object be a potential candidate for garbage collection?
- Discuss the Java error handling mechanism? What is the difference between Runtime (unchecked) exceptions and checked exceptions? What is the implication of catching all the exceptions with the type “Exception”?
- What is a user defined exception?
- What is the difference between processes and threads?
- Explain different ways of creating a thread?
- Briefly explain high-level thread states?
- What is the difference between yield and sleeping?
- How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply? What is the difference between synchronized method and synchronized block?
- What is a daemon thread?
- How can threads communicate with each other? How would you implement a producer (one thread) and a consumer (another thread) passing data (via stack)?
- If 2 different threads hit 2 different synchronized methods in an object at the same time will they both continue?
- Explain threads blocking on I/O?
- What is a singleton pattern? How do you code it in Java?
- What is a factory pattern?
- What is a socket? How do you facilitate inter process communication in Java?
- How will you call a Web server from a stand alone Java application?
- How would you improve performance of a Java application?
- How would you detect and minimise memory leaks in Java?
- Why does the JVM crash with a core dump or a Dr.Watson error?
- Did you have to use any design patterns in your Java project?
Java Interview Questions
Subscribe to:
Post Comments (Atom)
Very well written post !
ReplyDeleteA great blog for students and professionals
Java Training in Bangalore
This post is so useful and informative.Keep updating with more information.....
ReplyDeletePython Programming
Python From Basics