Top Java Interview Questions List for Freshers and Experience


Dear readers in “Top Java Interview Questions List for Freshers and Experience” post you will find all the important java interview questions which are asked most frequently by the interviewer for both freshers as well as experienced.

The following is the exhaustible list of java questions which you can refer in order to prepare for the upcoming interviews.

You can download the pdf version of this Java Interview questions bank by clicking the download option at last of this post.

Note: We will keep updating the list further more as we get a new java interview questions.

Top Java Interview Questions List for Freshers and Experience is as follows:

1. What is a class?
2. What is the difference between heap and stack?
3. What is the difference between instance variable and local variable?
4. What is a Constructor? Types of Constructor?
5. Difference between Break and Continue?
6. To exit the system from the current execution what command is used in java?
7. Addition features in Java 8?
8. Difference between for and for each loops in java and use of it?
9. Can we have multiple public class within a class?
10. What is inheritance? Types of inheritance? Does multiple inheritance allowed in java. If not, why?
11. What is polymorphism? How we can achieve it?
12. Difference between method overloading and method over riding?
13. Can we achieve method overloading when two methods have only difference in return type.
14. Method overloading and overriding examples in Selenium project?
15. What is encapsulation?
16. What is IS-A and HAS-A relation in java With examples?
17. What is final and super keyword? Difference between them?
18. Explain runtime polymorphism and compile time with examples?
19. Can final/Static method be overloaded?
20. Can final/Static methods be overridden?
21. Can we overload main method?
22. Can we execute a class without a main method?
23. What is Package?
24. What is an Abstract Class? Write an example code?
25. What is an Interface? What is the difference from Abstract class?
26. Can we use private and protect access modified inside a Interface?
27. Can multiple inheritances support in Interface?
28. Examples of Abstract and Interface used in selenium project?
29. What is Exception and what is the base class of it?
30. What is Final, Finally, Finalize?
31. What is done in finally block?
32. What is garbage collection java? How it is done?
33. What is the difference between Throws and Throw?
34. Gives some examples of java and Selenium?
35. What is Java Reflection, Singleton?
36. What is threading? How does multi threading achieved? How to initiate a thread in java? What do you mean by thread safe?
37. What is the difference between collection and collections?
38. Collection are what type?
39. Difference between Array and ArrayList?
40. Difference between Set and HashSet?
41. Difference between HashMap and HasTable?
42. Difference between ArrayList and LinkList?
43. How do you use Map collection your project?
44. Can we have duplicate key value in HasMap?
45. How to fetch values from a hashmap?
46. Difference between String, StringBuilder And StringBuffer?
47. What is java?
48. What are the differences between C++ and Java?
49. What are the features in JAVA?
50. What is an Object?
51. What is Encapsulation?
52. Explain public static void main(String args[]).
53. What is Polymorphism?
54. What is meant by Interface?
55. What is meant by Abstract class?
56. What are wrapper classes?
57. What are autoboxing and unboxing?
58. Difference between Public and Private access specifiers.
59. Difference between Default and Protected access specifiers.
60. Explain JDK, JRE and JVM?
61. Explain JIT compiler?
62. What are the various access specifiers in Java?
63. Difference between the Inner Class and Sub Class.
64. Difference between equals() and == in java?
65. Differentiate between Iterator and Enumeration?
66. Name the methods of Object Class?
67. Define a StringJoiner?
68. Explain final variable?
69. Explain final method?
70. Explain final class?
71. How many types of memory areas are allocated by JVM?
72. Explain Classloader?
73. Difference between the constructors and methods in java?
74. Explain static variable?
75. Explain static method?
76. Explain static block?
77. Explain this keyword in java?
78. Explain super keyword in java?
79. How constructor chaining can be done using this keyword?
80. Which class is the superclass for all the classes in java?
81. Explain Aggregation in java?
82. Explain composition in java?
83. Explain Object cloning in java?
84. How to create packages in Java?
85. What is String Pool?
86. What is the meaning of immutable String?
87. Why are the objects immutable in java?
88. What are the types of inner classes used in Java?
89. Explain Member Inner Class in java?
90. Explain Anonymous Inner Class in java?
91. Explain Local Inner Class in java?
92. Explain Static inner class in java?
93. What is serialization?
94. What is Deserialization?
95. Explain Socket programming in java?
96. Can we define more than one class in a single source files?
97. Explain how to perform Selection Sort in Java?
98. Explain how to perform Linear Search in Java?
99. Explain how to perform Bubble Sort in Java?
100. Explain how to perform Binary Search in Java?
101. Explain how to perform merge sort in Java?
102. Explain how to perform quicksort in Java?
103. Difference between static variables and non-static variables?
104. Why java class name starts with capital letter?
105. What is the reflection?
106. How can we access non-static members in the application?
107. Why main method is public static?
108. Why arguments array is of String type?
109. Why a class cannot be private?
110. Why a class cannot be protected?
111. Difference between this and super keyword?
112. Can we overload Constructor?
113.How is garbage collection controlled?
114. Explain Array?
115. What are the types of Array?
116. What are the primitive data types?
117. What are the non-primitive data types?
118. Explain Scanner class in java?
119. Difference between while and do-while loop?
120. Explain Assert statement in java?
121. Explain ‘? ‘ Operator in java?
122. Does java uses pointer?
123. Explain Thread Life cycle?
124. What is multi-threading?
125. What is Multitasking?
126. Difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
127. Explain FileInputStream and FileOutputStream ?
128. What is the transient keyword?
129. What is Externalizable?
130. Explain native method?
131. What do you mean by JShell programming?
132. Java 9 features?
133. Why java is platform independent?
134. Explain recursion in java?
135. Explain Checked and unchecked Exceptions?
136. Explain Varargs in java?
137. Explain For each loop in java?
138. Describe the Annotations?
139. difference between float and double data types?
140. Difference between Serializable and Externalizable interface?
141. What is string Literals?
142. difference between error and an exception?
143. Can constructor be inherited?
144. Explain type casting?
145. Difference between the >> and >>> operators in java?
146. What is daemon thread?
147. What is difference between Path and Classpath?
148. What is dot operator?
149. Define JIT compiler?
150. What is JAR file?

So these are the list of some java interview questions that will help you to crack java interview easily. Hope,you like this set of Java Interview Questions.


Leave a Comment