Topic Wise Java Interview Questions
Topic Wise Java Interview Questions
Basic Questions
1. What is Java? Why it is Object Oriented
2. What is JDK?
3. What is JVM?
4. What are the Features of Java?
5. What are Identifiers?
6. What are Variables, Keywords.
7. What is Oops.
8. What is SingleTon Class.
9. How many members are present in the blank class?
10. Is Java completely object-oriented?
11. what are objects and how to create
12. explain string memory management.
13. difference between a constant pool and a non-constant pool.
PolyMorphism
1. What is the difference b/w compile time polymorphism and Run time
polymorphism?
2. What is Run Time Polymorphism?
3. Can you achieve run time polymorphism by Data Members?
4. what is the difference between static binding and dynamic binding?
5. what is the Java instance operator?
Abstraction
1. What is the abstraction?
2. What is the abstract class?
3. Can there be an abstract method without an abstract class?
4. Can you use abstract and final both with a method.
5. Is it possible to instantiate the abstract class?
6. What is the interface?
7. Can you declare an interface method static?
8. Can the interface be final?
9. What is a marker interface?
10. What is the difference between abstract class and interface?
11. Can we define private and protected modifiers for the members in the
interface?
12. When can an object reference be cast to an interface reference?
13. Can we make the abstract class final?
14. Can we create a constructor for the abstract class?
15. How to invoke abstract class constructors.
16. Can we overload abstract methods?
17. Can we override abstract methods?
18. Can we achieve multiple inheritance using java?
19. Will the abstract class inherit the object class?
20. How to achieve abstraction.
21. What is the outcome of abstraction?
Encapsulation
1. What is Encapsulation?
2. How to achieve Encapsulation.
3. Explain Java Bean Class.
4. Explain Java bean Encapsulation.
5. How to make a read-only class in Java.
6. How to make a write-only class in Java.
7. What are the advantages of encapsulation in Java?
Packages
Exception Handling
1. What is an exception?
2. What is exception handling?
3. In how many ways we can handle exceptions?
4. How many types of exceptions are there?
5. What is a checked exception?
6. What is an unchecked exception?
7. Can we write more than one catch for a single try block?
8. What is a generalized catch block
9. What is written within try block
10. What is written within a catch block
11. What is finally block
12. Can we write finally block without catch block
13. Explain the hierarchy of Java Exception classes.
14. What is the difference between a Checked Exception and an Unchecked
Exception?
15. What is the base class for Error and Exception?
16. Is it necessary that each try block must be followed by a catch block?
17. Is there any case when finally will not be executed?
18. What is the throw keyword?
19. What are throws?
20. What is the difference between throws and throws?
21. Can an exception be rethrown?
22. Can the subclass overriding method declare an exception if the parent class
method doesn't throw an exception?
23. What is exception propagation?
24. difference between throw, throws, and throwable.
25. Difference between final, finally and final
Inheritance.
final keyword
Collections
{Basic Concepts}
1. What are the main classes that implement the List interface?
2. What are the main classes that implement the Set interface?
3. What are the main classes that implement the Map interface?
4. How does ArrayList differ from Vector?
5. How does LinkedHashSet differ from HashSet?
6. What is a PriorityQueue? How does it differ from other queues?
7. What is a ConcurrentHashMap and how does it differ from a HashMap?
8. What is an EnumSet and when would you use it?
9. What is a WeakHashMap and when would you use it?
10. What is an IdentityHashMap and when would you use it?
Advanced Topics