0% found this document useful (0 votes)
74 views6 pages

Java Interview Questions List

The document contains a list of 143 interview questions related to Java programming concepts such as object-oriented programming, exceptions, threads, collections, JDBC and more. The questions cover topics like type conversion, wrapper classes, method overloading, static methods, inheritance, abstraction, encapsulation, garbage collection, streams, serialization, multithreading and synchronization.

Uploaded by

Aniket behal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
74 views6 pages

Java Interview Questions List

The document contains a list of 143 interview questions related to Java programming concepts such as object-oriented programming, exceptions, threads, collections, JDBC and more. The questions cover topics like type conversion, wrapper classes, method overloading, static methods, inheritance, abstraction, encapsulation, garbage collection, streams, serialization, multithreading and synchronization.

Uploaded by

Aniket behal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

INTERVIEW QUESTIONS

1. What are types of type conversion?


2. What are wrapper classes used for?
3. Conversion of float to int is implicit type conversion or explicit type
conversion?
4. Different classes that can be used to accept input from user.
5. What are allowed data types in switch case?
6. Difference between else if and switch
7. Difference between while and do while
8. What is criteria for method overloading
9. How do you know if method call is call by value or call by reference
10.What is advantage and disadvantage of temporary instance
11.What is has a and is a relation in java classes
12.Different usage of final keyword in java
13.What is the abstraction?
14.What is the difference between abstraction and encapsulation?
15.What gives Java its 'write once and run anywhere' nature?
16.How many types of memory areas are allocated by JVM?
17.What is the difference between an object-oriented programming language and
object-based programming language?
18.Is delete, next, main, exit or null keyword in java?
19.If I don't provide any arguments on the command line, then what will
the value stored in the String array passed into the main() method,
empty or NULL?
20.What if I write static public void instead of public static void?
21.What is the default value of the local variables?
22.What is object-oriented paradigm?
23.Does constructor return any value?
24.Is constructor inherited?
25.Can you make a constructor final?
26.Can we overload the constructors?
27.What is the static method?
28.What are the restrictions that are applied to the Java static methods?
29.Why is the main method static?
30.Can we override the static methods?
31.What is the static block?
32.What are the differences between String and StringBuffer?
33.What are the differences between StringBuffer and StringBuilder?
34.What if the static modifier is removed from the signature of the main
method?
35.Can we make constructors static?
36.Can we make the abstract methods static in Java?
37.What are the advantages of passing this into a method instead of the
current class object itself?
38.Which class is the superclass for all the classes?
39.Why does Java not support pointers?
40.What are the differences between this and super keyword?
41.Why can we not override static method?
42.Can we override the overloaded method?
43.Can we override the private methods?
44.Can we change the scope of the overridden method in the subclass?
45.Can we modify the throws clause of the superclass method while
overriding it in the subclass?
46.Can you declare the main method as final?
47.Can we declare an interface as final?
48.What is the difference between the final method and abstract method?
49.What is Java instanceOf operator?
50.Can subclass overriding method declare an exception if parent class
method doesn't throw an exception?
51.What are the advantages of Java inner classes?
52.What are the disadvantages of using inner classes?
53.How is garbage collection controlled?
54.Can an unreferenced object be referenced again?
55.What kind of thread is the Garbage collector thread?
56.What do you understand by an IO stream?
57.What is the difference between the Reader/Writer class hierarchy and
the InputStream/OutputStream class hierarchy?
58.What are the super most classes for all the streams?
59.Can a Serialized object be transferred via network?
60.Give a brief description of Java socket programming?
61.What is Socket?
62.What is the purpose of using java.lang.Class class?
63.Can there be an abstract method without an abstract class?
64.Is it possible to instantiate the abstract class?
65.What is the interface?
66.Can you declare an interface method static?
67.Can we define private and protected modifiers for the members in
interfaces?
68.When can an object reference be cast to an interface reference?
69.What is String Pool?
70.Why are the objects immutable in java?
71.Why java uses the concept of the string literal?
72.Is there any difference between nested classes and inner classes?
73.What is Garbage Collection?
74.What is gc()?
75.What kind of thread is the Garbage collector thread?
76.What is the difference between final, finally and finalize?
77.What is the purpose of the Runtime class?
78.Give the hierarchy of InputStream and OutputStream classes.
79.What do you understand by an IO stream?
80.What is the difference between the Reader/Writer class hierarchy and
the InputStream/OutputStream class hierarchy?
81.What are the super most classes for all the streams?
82.What are the FileInputStream and FileOutputStream?
83.What is the purpose of using BufferedInputStream and
BufferedOutputStream classes?
84.What is serialization?
85.How can you make a class serializable in Java?
86.What is object cloning?
87.What are the advantages and disadvantages of object cloning?
88.What is a native method?
89.What is the purpose of the System class?
90.Is there is any difference between a Scrollbar and a ScrollPane?
91.When should we interrupt a thread?
92.How is the safety of a thread achieved?
93.What do you understand by thread pool?
94.What is the difference between Synchronous programming and
Asynchronous programming regarding a thread?
95.What is a Thread?
96.How do you make a thread in Java?
97.Explain about join () method.
98.What does the yield method of the Thread class do?
99.Explain about wait () method.
100. How to stop a thread in java? Explain about sleep () method in a
thread?
101. When to use the Runnable interface Vs Thread class in Java?
102. Difference between start() and run() method of thread class.
103. What is Multi-threading?
104. Explain the thread life cycle in Java.
105. What is Synchronization?
106. What is the disadvantage of Synchronization?
107. Which methods are used during the Serialization and
Deserialization process?
108. What is meant by Serialization?
109. Difference between Serialization and Deserialization in Java.
110. What is classloader?
111. What is the difference between Collection and Collections?
112. What is the difference between Comparable and Comparator?
113. What does the hashCode() method do?
114. Why we override equals() method?
115. Difference between notify() method and notifyAll() method in Java.
116. Difference between HashMap and HashTable.
117. Difference between HashSet and TreeSet.
118. What is mean by Collections in Java?
119. What are all the Classes and Interfaces that are available in the
collections?
120. What is meant by Ordered and Sorted in collections?
121. Explain the different lists available in the collection.
122. Explain about Set and their types in a collection?
123. Explain about Map and their types.
124. What is meant by Exception?
125. What are the types of Exceptions?
126. What are the advantages of Exception handling?
127. What are the Exception handling keywords in Java?
128. Explain about Exception Propagation.
129. What is the difference between Checked Exception and Unchecked
Exception?
130. What is the base class for Error and Exception?
131. Is it necessary that each try block must be followed by a catch
block?
132. What is finally block?
133. Can finally block be used without a catch?
134. Is there any case when finally will not be executed?
135. What is the difference between throw and throws?
136. Can an exception be rethrown?
137. What is JDBC?
138. What is JDBC Driver?
139. What are the steps to connect to the database in java?
140. What are the different types of ResultSet?
141. What comes to mind when someone mentions a shallow copy in
Java?
142. Explain the Priority Queue.
143. Does each thread have its stack in multithreaded programming?

You might also like