You are on page 1of 7

Java History

1. Java was designed by ______________________.


2. Earlier name of Java Programming language was –
3. Which kind of language java is
4. Java is a ________ programming language
5. Who created java and where it is created

Architecture (JAVA)
1. What is jdk
2. What is jre
3. What is jvm

Architecture (JVM)
1. What is class loader
2. What is memory area
3. What is execution engine
4. What is interpreter
5. What is compiler

Class and Objects


1. What is class
2. What is object
3. How many classes can you create with a class ?
4. Why we use new keyword to create object
5. In memory area where object will get stored

Data types and variables


1. What is data
2. What is data type
3. What is variable
4. Primitive data type
5. Non primitive data type
6. Difference between float and double
7. What is the range of int and long
8. Default value of primitive and non primitive data type

String
1. What is string?
2. Why string is default immutable
3. D/f between string buffer and string builder
4. Any 5 inbuild methods in string
5. Is string class , keyword or data type
6. How we can create and string
7. What is == and .equal in string

Array
1. What is array
2. Can we can the size of array
3. Is array size fixed
4. Index value of array
5. How to create and array
6. Difference between 1d array and 2d array
7. Default value of array
8. Can we add or delete an element after assigning an arr

Inheritance
1. What is Inheritance in Java?
2. What are the types of inheritance in Java?
3. Why do we need to use inheritance?
4. What is Is-A relationship in Java?
5. What is super class and subclass?
6. How is Inheritance implemented/achieved in Java?
7. Which class in Java is superclass of every other class?
8. Can a class extend itself?
9. Can we assign superclass to subclass?
10. Can a class extend more than one class?
11. Are constructor and instance initialization block inherited to subclass?
12. Can we extend (inherit) final class?
13. Can a final method be overridden?
14. Can we inherit private members of base class to its subclass?
15. Why multiple inheritance is not supported in java through class?
16. Can we access subclass members if we create an object of superclass?
17. Can we access both superclass and subclass members if we create an object of
subclass?
18. What happens if both superclass and subclass have a field with the same name?

Polymorphism
1. What is Polymorphism in Java oops?
2. What are the types of Polymorphism in Java?
3. What are different ways to achieve or implement polymorphism in Java?
4. What are the differences between Polymorphism and Inheritance in Java?
5. What is Compile time polymorphism (Static polymorphism)?
6. What is Run time polymorphism (Static polymorphism)?
7. How to achieve/implement dynamic polymorphism in Java?
8. What are the types of binding in Java?
9. Why static binding is also called early binding in Java?
10. Why binding of private, static, and final methods are always static binding in
Java?
11. Is it possible to implement runtime polymorphism by data members in Java?
12. What is Method Overloading and Method Overriding?

Abstraction
1. What is Abstraction in Java?
2. How to achieve or implement Abstraction in Java?
3. What is the difference between abstract class and concrete class?
4. Can abstract modifier applicable for variables?
5. What is Abstract method in Java?
6. Can an abstract method be declared as static?
7. Can an abstract method be declared with private modifier?
8. When to use Abstract class in Java?
9. When to use Abstract method in Java?
10. Is it possible to create an object of abstract class in Java?
11. Can an abstract class have constructor?
12. Is it possible to achieve multiple inheritance through abstract class?
13. Can we make an abstract class without abstract keyword?
14. What is the difference between Abstraction and Encapsulation?
15. Why abstract class has constructor even though you cannot create object?

Encapsulation
1. What is Encapsulation in Java? Why is it called Data hiding?
2. How to achieve encapsulation in Java? Give an example.
3. What is the difference between Abstraction and Encapsulation?
4. Can we achieve abstraction without encapsulation in Java?
5. What are getter and setter methods in Java?

E.g . You have account number 121213133423523 and this property is PRIVATE and
client want to make some modification in the account number. What to do?

Collection Questions:
1. What are the benefits of collection framework over arrays?
2. What are frameworks?
3. What are Collection?
4. Which is the root interface of collection framework?
5. What is Collections?
6. What is the difference between collection and collections?
7. Why should we use collection frameworks?
8. What is the difference between Iterable and Iterator?
9. What are the advantages of collection framework?
10. Describe the collection hierarchy in Java.
11. Why collection doesn’t extend Cloneable and
Serializable interfaces?
12. Difference between Comparator and Comparable.
13. How are the collection objects sorted in java?
14. What is List interface? Explain their features.
15. What is ArrayList? Explain it’s features.
16. Difference between ArrayList and Arrays.
17. What is LinkedList? Explain it’s features.
18. What is Vector? Explain it’s features.
19. What is Stack? Explain it’s features.
20. Difference between ArrayList and LinkedList.
21. How to convert ArrayList to Arrays?
22. How to convert Arrays to ArrayList?
23. How to convert ArrayList to LinkedList?
24. Difference between Singly Linked List and Doubly
Linked List.
25. How to set size during object creation for List interface?
26. What is Queue interface? Explain their features.
27. What are the important methods of Queue interface?
28. What is priority queue? Explain it’s features.
29. What is ArrayDeque?
30. What is Set interface? Explain their features.
31. What is HashSet? How is objects stored in it?
32. What is emptySet()?
33. What is LinkedHashSet? Explain their features.
34. What is Map interface? Explain their features. 35. Why Map interface doesn’t
extend Collection interface?
36. Can a class be used as Map key?
37. Difference between HashMap and HashTable
38. Difference between List, Queue and Set interfaces.
39. Difference between Iterator and Enumeration.
40. Difference between HashSet and TreeSet.

Thread Questions:
1. What are threads?
2. What do you mean by multi-threading?
3. What do you mean by multi-tasking?
4. What is a thread life cycle?
5. What are the advantages of Multi-Threading?
6. What are the different ways to achieve Multi-Threading in java?
7. What is start()?
8. What is run()?
9. Where is start() present?
10. Why do we use start() to invoke run()?
11. List out the difference between Thread and Process.
12. List out the difference between class lock and object lock.
13. What is daemon and non-daemon threads?
14. What are wait(), sleep() and yield()?
15. What is the major differences between notify() and notifyAll()?
16. What is callable interface?
17. What is garbage collection?
18. What is deadlock and how does it occur?
19. What is synchronize()?
20. What is synchronization?
21. What is finalize()?
22. What is synchronized block?
23. What is Thread Scheduler?
24. What is Time Slicing?
25. What are the different properties of Thread? Explain.
26. What will happen if run() is not overridden?
27. Can a thread get it’s own execution time and stack?

Exception Handling Questions:


1. What is exception?
2. What is an error?
3. What is the difference between exception and error?
4. How can an exception be handled?
5. What is try-catch block?
6. What is finally()?
7. What is throw?
8. What is throws?
9. Difference between throw and throws?
10. List out the major keywords used in exception handling.
11. Why are exceptions handled in java?
12. List and briefly explain about different types of exceptions.
13. What is the difference between final, finally and finalize?
14. What is the difference between noclassdeffounderror and classnotfoundexception
in Java?
15. Can we throw an exception explicitly or manually?
16. What is printstacktrace()?
17. When does outofmemoryerror occurs? How to handle it?
18. Which is the root interface of exceptions?
19. When does unreachable code error occur in java?
20. List out the exceptions that commonly occur while using
Arrays.
21. Can we include only try block without catch block?
22. What is the difference between runtimeexception and
Compiletimeexception?

You might also like