0% found this document useful (0 votes)
3 views

JAVA Interview Question Bank

The document contains a comprehensive list of questions related to Java programming, covering topics such as Java features, object-oriented programming concepts, arrays, exception handling, collections, threads, and file I/O. Each question aims to explore fundamental and advanced concepts in Java, making it a valuable resource for learners and practitioners. The questions are structured to encourage in-depth understanding and practical application of Java programming principles.

Uploaded by

48Vedant Kadole
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

JAVA Interview Question Bank

The document contains a comprehensive list of questions related to Java programming, covering topics such as Java features, object-oriented programming concepts, arrays, exception handling, collections, threads, and file I/O. Each question aims to explore fundamental and advanced concepts in Java, making it a valuable resource for learners and practitioners. The questions are structured to encourage in-depth understanding and practical application of Java programming principles.

Uploaded by

48Vedant Kadole
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

JAVA Programming

Basic
Q1. Explain features of Java?
Q2. Explain Why java is pure object oriented?
Q3. Explain What is byte code and Why java develop by code?
Q4. Explain What is JDK , JRE JVM?
Q5. Explain Difference between JDK JRE and JVM?
Q6. What is a Command line argument and Why use it?
Q7. What does OOP explain with an example?
Q8. Can we overload the main method?
Q9. Can we pass different parameters in the main function other than string?
Q10. Explain Bitwise Operator in Java?
Q11. Is the JVM platform dependent or independent to explain with reason?
Q12. What happens if we declare the main method as non-static?
Q13. What is the difference between platform independency and cross platform?
Q14. How can we say java is a secure language?
Q15. What is a loop and explain its type?
Q16. What is the use of break and continue keyword in loop?
Q17. Can we use variable arguments as parameters in the main method?
Q18. What are command line arguments and why use it to explain with an example?
Q19. What is a Scanner class and why use it?
Q20. What is for each loop in Java and explain with syntax?
Q21. What is the difference between a normal loop and for each loop?
Q22. What is Array in Java and explain with syntax and example?
Q23. Explain how many ways to declare arrays in Java?
Q24. Explain types of arrays in java?
Q25. What is an anonymous array in JAVA?
Q26. What is Jagged Array in JAVA?
Q27. Is it true java array is reference data type and if yes then prove how and if no then prove
how?
Q28. How to initialise the JAVA Array?
Q29. How to copy data from one array to another array?
Q30. What is the base address and explain in depth?
Q31. Is it possible to declare array size as negative and if declare then what happens?
Q32. What is the difference between int a[] and []a?
Q33. What is the default value array in Java?
Q34.How many ways to find the duplicate element from an array?
Q35.Is it possible to declare array size as negative?
Q36.When ArrayIndexOutOfBoundsException occurs?
Q37. What are the advantages and disadvantages of arrays?
Q38. What is the difference between do while and while loop?
Q39. Can we use for loop like as while and explain with an example?
Q40. What is the difference between break and continue keyword?
Q41. What is the label concept in java loop?
Q42. What is a two dimensional array and why use it?

OOP’S
Q43. What is class and why use it?
Q44. is it true class is user defined data type if yes explain in depth how?
Q45. is it a true class to help us to provide data security and explain in depth?
Q46.is it true class is complex data type?
Q47. How can we reuse class more than one time?
Q48. What is variable argument in java?
Q49. How to pass an array as a parameter in a function/method explained with an example?
Q50. What is POJO class and why use it?
Q51. What is encapsulation and how can we achieve it explained with an example?
Q52. What is a static keyword and explain in depth?
Q53. What is the difference between static variable and instance variable?
Q54. What is the difference between instance variable and local variable?
Q55. Can we declare local variables as static?
Q56. Can we use the access specifier with a local variable?
Q57. What are default values to static and instance variables?
Q58. is it true that the local variable has no default value?
Q59. What is the difference between reference and object in memory?
Q60. What is an anonymous object in java?
Q61. What is an array of objects in java and why use it to explain with an example?
Q62. What are nested classes and explain types of nested classes?
Q63. Can we declare class as private & explain with an example?
Q64. Can we declare class as static & explain with an example?
Q65. Can we declare class as protected and explain with an example?
Q66. What is this reference in java and explain with an example?
Q67. Can we access static variables by using this reference?
Q68. Can we call a static function by using class name and explain with an example?
Q69. Can we use non-static variables in a static function?
Q70. Can we use the static variable in a non-static function?
Q71. What is the permanent generation section in JVM memory?
Q72. What is a constructor in JAVA and why use it to explain with an example?
Q73. Is it true every class contains one implicit constructor?
Q74. Explain the types of constructors in java with simple code examples and syntax?
Q75. What is this() constructor and why use it?
Q76. What is constructor chaining in JAVA?
Q77. is it true we can write this() constructor in the second line of code?
Q78. Can constructors support inheritance?
Q79. Explain constructor overloading in JAVA with an example?
Q80. Can we declare the constructor as static and explain with reason?
Q81. Can we declare the constructor as final and explain with reason?
Q82. Can we give the return type to the constructor and what happens?
Q83. Can we declare the constructor as static?
Q84. Can we declare a constructor as abstract?
Q85. What is the singleton class and explain with an example?
Q86. What is the utility class and explain with an example?
Q87. What is the difference between constructor and function?
Q88. What is the constructor chaining explained with an example?
Q89. What is inheritance and why use it to explain with an example?
Q90. Can we create a java program without inheritance?
Q91. is it true that the object class is the parent of every class in JAVA?
Q92. Explain types of inheritance?
Q93. Explain the super() constructor with an example?
Q94. is it true when the parent class contains the default constructor and when we create an object of the
child class then the parent constructor gets executed?
Q95. What is the final keyword and explain with an example?
Q96. is it true super() must be the first line of code in the child class constructor?
Q97. How can we avoid method overriding in JAVA?
Q98. Can we override the final method in java?
Q99. Can we override the static method in JAVA?
Q100. Can we override the protected method of parents as public in child class?
Q101. Can we override the default method of parents as protected in child class?
Q102. Can we override the public method as protected in child class?
Q103. Can we override the protected method of parent as default in child class?
Q104. What is the method hiding in JAVA?
Q105. What is Dynamic polymorphism and how can we achieve it explained with an example?
Q106. What is the difference between method overloading and method hiding in JAVA?
Q107. What is the difference between Compile time polymorphism and Dynamic polymorphism?
Q108. What is abstract class and abstract method in JAVA?
Q109. What is the actual benefit of abstract class and abstract method in JAVA?
Q110. What is abstraction and why use it?
Q111. What is the difference between abstraction and encapsulation?
Q112. Can we declare an abstract method as a final explanation with reason?
Q113. Can we declare an abstract method as a static explanation with reason?
Q114. Is it true that abstract method classes must be abstract?
Q115. is it true that abstract classes can have non abstract methods?
Q116. What is a concrete class in JAVA?
Q117. What is an adapter class and why use it?
Q118. Can we declare references to abstract class?
Q119. How can we achieve dynamic polymorphism by using abstract classes?
Q120. What is Coupling and explain its types?
Q121.What is tight coupling and loose coupling in JAVA?
Q122. What is interface in java?
Q123. Why use interfaces in JAVA?
Q124. What is the diamond problem and how can we solve it using the interface?
Q125. Is it true interface methods are public static and abstract?
Q126, is it true interface variables are by default public static final?
Q127. Can we declare a constructor in the interface?
Q128. Can we declare a constructor in the abstract class?
Q129. What is the benefit of an abstract class constructor if we do not create its object?
Q130. Why does the interface not use a constructor if it is internally abstract?
Q131. Can we declare interface reference and how do we declare it?
Q132. Can we declare interface methods as static?
Q134. Can we declare interface methods as protected?
Q135. Can we declare abstract class methods as protected in abstract class?
Q136. What is the difference between abstract class and interface?
Q137. Explain an example of multiple inheritance using an interface?
Q138. Is it true interface inheritance can be performed using extends keyword?
Q139. Can we declare interface within class or class within interface?
Q140. Can we define a method within the interface by using static or default keywords?
Q141. Can we declare interface methods as private?
Q142. Can we use an interface for 100% abstraction?
Exception
Q143. What is an exception in Java and why use it?
Q144. Explain types of exceptions in java?
Q145. How does exception handling help developers?
Q146. Explain Hierarchy of Exceptions in java?
Q147. What is the difference between error and exception in Java?
Q148. Explain any 5 classes of Runtime exceptions?
Q149. Explain any 5 classes of compile time exception or checked exception?
Q150. Explain any 5 error related exception classes?
Q151. What is the throw and throws keyword explained with an example?
Q152. Can we write try without catch?
Q153. Can we write try with more than one catch block?
Q154. Can we write try and finally without catch?
Q155. What is the difference between finally and catch block?
Q156. What is the difference between throws and throws?
Q157. What is the user defined exception and why do we need to declare a user defined
exception?
Q158. How can we create user defined exceptions in Java?
Q159 What is try with resource bundle concept?
Q160. Can we use more than one exception at a time in a single catch block?
Wrapper Class
Q161. What are wrapper classes in java and Why use it?
Q162. Explain hierarchy of wrapper classes?
Q163. Explain the Number class with its method?
Q164. What is the use of xxxValue() method?
Q165. What is the use of the valueOf() method?
Q166. What is the parseXXX() method and explain with an example?
Q167. What is String in Java?
Q168. How many ways to create the string in java?
Q169. What is the difference between string object creation using initialization and using a new
keyword?
Q170. What is the heap section in memory?
Q171. What is the string constant pool in Java?
Q172. What is the StringBuffer and StringBuilder in Java?
Q173. Can we create a StringBuffer by using the initialization technique?
Q174. What is the difference between String and StringBuffer?
Q175. What is the difference between StringBuffer and StringBuilder?
Q176. Explain any 10 methods of String with examples?
Q178. Explain constructor of String class?

Collection
Q179. What is a collection and why use it?
Q180. Explain collection hierarchy?
Q181. Explain different types of collections?
Q182. What is the difference between list ,set and queue?
Q189. What is Vector and explain all constructors of Vector?
Q190. is vector thread safe or not?
Q191. What is ArrayList and explain the difference between Vector and ArrayList?
Q192. What are the cursors in the collection and explain the types of cursor?
Q193. What is the difference between Iterator and Enumeration?
Q194. What is the difference between Iterator and ListIterator?
Q195. What is the difference between ArrayList and LinkedList?
Q196. Explain 10 methods of Collection?
Q197. What is Set collection and explain types of Set collection?
Q198. What is the difference between HashSet, LinkedHashSet and TreeSet?
Q199. is it true Treeset can store null value?
Q200. What is the Map in java and explain the types of Map?
Q201. What is the difference between HashMap and LinkedHashMap?
Q202. What is the TreeMap?
Q203. What is the difference between collections and Map?
Q204. What is Comparable and Comparator in Java and why use it?
Q205. What is the difference between Comparable and Comparator?
Q206. What is an Object and explain its methods?
Q207. What is object cloning in Java and why use it ?
Q208. What is equals() method and hashCode() and why use it?
Q209. What is the toString() method and why use it?
Q210. What is the difference between static block and instance block?
Q211. how to convert ArrayList to Set?
Q212. What is a Collections class and why use it?
Q213. Explain the methods of the Collections class?
Q214. How to convert ArrayList as a synchronized collection?
Q215. How to convert HashMap to synchronized collection?

Thread
Q216. What is the thread and why use it?
Q217. What is the process?
Q218. What is the difference between Thread and process?
Q219. What is multithreading in java?
Q220. How many ways to implement the thread using JAVA?
Q221. Explain the Thread class and its method?
Q222. is it true Runnable is a marker interface?
Q223. is it true that Runnable is a functional interface?
Q224. What is synchronisation and asynchronization?
Q225. What is the join() method and why use it?
Q226. What is the wait(),notify() and notifyAll() method?
Q227. What is the volatile keyword?
Q228. What is the difference between the wait() and sleep() method?
Q229. What is the thread priority and why use it?
Q230. Explain different types of thread priority in Java?
Q.231. What is the Daemon thread in java and how to create a user defined thread as a
daemon thread?
Q232. Give some names of daemon threads in java?
Q234. How to create thread using Runnable interface in Java?
Q235. Can we create Thread without using inheritance?
Q236. What is the deadlock in thread?
File
Q237. What is the I/O Stream in java?
Q238. Explain types of Stream classes?
Q239. Explain Hierarchy of Writer and Reader classes?
Q240. Explain Writer class and its all methods?
Q241. Explain the OutputStream class and its all methods?
Q242. Explain Reader class and its all methods?
Q243. Explain the FileWriter class with its examples?
Q244. Explain the BufferedWriter class with its example?
Q245. Explain the difference between FileWriter and BufferedWriter class?
Q246. Explain the FileOutputStream class with an example?
Q247. Explain the FileInputStream class with an example?
Q248. Explain the difference between Stream and Writer/Reader classes?
Q249. What is Serialization with an example?
Q250. What is Deserialization with an example?
Q251. is it true that Serializable is a marker interface?
Q252 Can we define method within interface
Q253.Can we define a default method within the interface?
Q254. What is Anonymous inner class?
Q255. What is the Lambda expression and why use it?
Q256. What is the Functional interface in java?
Q257. How can we create our own interface as Functional interface?
Q258. What are Consumer, Function, Predicate and Supplier interfaces explained with an
example?
Q259. What is the Stream API and explain with an Example?
Q260. Explain the filter(),map() ,reduce() method with an example?
Q261, Explain the Optional class and why use it ?

You might also like