480 Core Java Interview Questions (Part 2)

This guide having 480 Core Java interview questions will help you in revising most asked core java interview questions for both junior and senior developers.

core java interview questions

101. Why Java provides Garbage Collector?
102.What is the purpose of gc() in Java?
103.How does Garbage Collection work in Java?
104.When does an object become eligible for Garbage Collection in Java?
105.Why do we use finalize() method in Java?
106.What are the different types of References in Java?
107.How can we reference an unreferenced object again?108.What kind of process is the Garbage collector thread?
109.What is the purpose of the Runtime class?
110. How can we invoke an external process in Java?
111. What are the uses of Runtime class?
Inner Classes
112. What is a Nested class?
113. How many types of Nested classes are in Java?
114. Why do we use Nested Classes?
115. What is the difference between a Nested class and an Inner class in
116. What is a Nested interface?
117. How can we access the non-final local variable, inside a Local Inner
118. Can an Interface be defined in a Class?
119. Do we have to explicitly mark a Nested Interface public static?
120.Why do we use Static Nested interface in Java?
121. What is the meaning of Immutable in the context of String class in
122.Why a String object is considered immutable in java?
123.How many objects does following code create?
124.How many ways are there in Java to create a String object?
125.How many objects does following code create?126.What is String interning?
127.Why Java uses String literal concept?
128.What is the basic difference between a String and StringBuffer
129.How will you create an immutable class in Java?
130.What is the use of toString() method in java ?
131. Arrange the three classes String, StringBuffer and StringBuilder in
the order of efficiency for String processing operations?
Exception Handling
132.What is Exception Handling in Java?
133.In Java, what are the differences between a Checked and
134.What is the base class for Error and Exception classes in Java?
135.What is a finally block in Java?
136.What is the use of finally block in Java?
137.Can we create a finally block without creating a catch block?
138.Do we have to always put a catch block after a try block?
139.In what scenarios, a finally block will not be executed?
140.Can we re-throw an Exception in Java?
141. What is the difference between throw and throws in Java?
142.What is the concept of Exception Propagation?
143.When we override a method in a Child class, can we throw an
additional Exception that is not thrown by the Parent class method?
Multi-threading144.How Multi-threading works in Java?
145.What are the advantages of Multithreading?
146.What are the disadvantages of Multithreading?
147.What is a Thread in Java?
148.What is a Thread’s priority and how it is used in scheduling?
149.What are the differences between Pre-emptive Scheduling Scheduler
and Time Slicing Scheduler?
150.Is it possible to call run() method instead of start() on a thread in
151. How will you make a user thread into daemon thread if it has already
152.Can we start a thread two times in Java?
153.In what scenarios can we interrupt a thread?
154.In Java, is it possible to lock an object for exclusive use by a thread?
155.How notify() method is different from notifyAll() method?
156.What are the differences between the two data structures: a Vector
and an ArrayList?
157.What are the differences between Collection and Collections in Java?
158.In which scenario, LinkedList is better than ArrayList in Java?
159.What are the differences between a List and Set collection in Java?
160.What are the differences between a HashSet and TreeSet collection
in Java?
161. In Java, how will you decide when to use a List, Set or a Mapcollection?
162.What are the differences between a HashMap and a Hashtable in
163.What are the differences between a HashMap and a TreeMap?
164.What are the differences between Comparable and Comparator?
165.In Java, what is the purpose of Properties file?
166.What is the reason for overriding equals() method?
167.How does hashCode() method work in Java?
168.Is it a good idea to use Generics in collections?
Mixed Questions
169.What are Wrapper classes in Java?
170.What is the purpose of native method in Java?
171. What is System class?
172.What is System, out and println in System.out.println method call?
173.What is the other name of Shallow Copy in Java?
174.What is the difference between Shallow Copy and Deep Copy in
175.What is a Singleton class?
176.What is the difference between Singleton class and Static class?
Java Collection
177.What is the difference between Collection and Collections
Framework in Java?
178.What are the main benefits of Collections Framework in Java?
179.What is the root interface of Collection hierarchy in Java?180.What are the main differences between Collection and Collections?
181. What are the Thread-safe classes in Java Collections framework?
182.How will you efficiently remove elements while iterating a
183.How will you convert a List into an array of integers like- int[]?
184.How will you convert an array of primitive integers int[] to a List
185.How will you run a filter on a Collection?
186.How will you convert a List to a Set?
187.How will you remove duplicate elements from an ArrayList?
188.How can you maintain a Collection with elements in Sorted order?
189.What is the difference between Collections.emptyList() and creating
new instance of Collection?
190.How will you copy elements from a Source List to another list?
191. What are the Java Collection classes that implement List interface?
192.What are the Java Collection classes that implement Set interface?
193.What is the difference between an Iterator and ListIterator in Java?
194.What is the difference between Iterator and Enumeration?
195.What is the difference between an ArrayList and a LinkedList data
196.What is the difference between a Set and a Map in Java?
197.What is the use of a Dictionary class?
198.What is the default size of load factor in a HashMap collection in
Java?199.What is the significance of load factor in a HashMap in Java?
200.What are the major differences between a HashSet and a HashMap?

Continue with 480 Core Java Interview Questions (Part 3)

Leave a Comment


Please share it if you found this useful
Hide Buttons