Monday, March 2, 2015

Master List Of Core Java Questions

  1. What is an Object?

  2. What is a Class?

  3. What is OOAD?

  4. What is Data Abstraction ?

  5. What is Data Encapsulation?

  6. What is the difference between Data Abstraction and Information Hiding?

  7. What is Inheritance and what are different types of it?

  8. Why Java uses Singly rooted hierarchy?

  9. Why does Java not support Multiple Inheritance?

  10. Why is Java not 100% pure OOP language?

  11. What is Early Binding?

  12. What is Polymorphism/Late Binding?

  13. What is method overloading?

  14. What is method overriding?

  15. How is Java different from C++?

  16. What is UML and how is it useful in designing large systems?

  17. Is UML useful for procedural programming ?

  18. What are different notations used in UML ?

  19. What is a Use case and an Actor?

  20. How to identify an Actor?

  21. What is Generalization?

  22. What is Association and how it maps into a Java class?

  23. What is Aggregation and how it maps into a Java class?

  24. What is Composition and how it maps into a Java class?

  25. What is Dependency and how it maps into a Java class?

  26. What is the purpose of State machine diagrams?

  27. What are different kinds of Structure diagrams?

  28. What are different kinds of Interaction diagrams?

  29. What are different kinds of Behavior diagrams?

  30. Java Fundamentals

  31. What is a Java Virtual Machine (JVM)?

  32. What is a JVM consisted of?

  33. What is a class loader and what is its responsibilities?

  34. What is heap and stack?

  35. How is your Java program executed inside JVM?

  36. What is Java class file's magic number?

  37. How JVM performs Thread Synchronization?

  38. How JVM performs Garbage Collection?

  39. How to profile heap usage?

  40. What will you do if VM exits while printing "OutOfMemoryError" and increasing max heap size doesn't help?

  41. Should one pool objects to help Garbage Collector?Should one call System.gc() periodically?

  42. An application has a lot of threads and is running out of memory, why?

  43. If your program is I/O bound or running in native methods, do these activities engage JVM?

  44. What is the difference between interpreted code and compiled code?

  45. Why Java based GUI intensive program has performance issues?

  46. What is 64 bit Java ?

  47. What is the difference between JVM and JRE?

  48. What are different primitive datatypes in Java?

  49. What are expressions,statements and blocks in Java?

  50. What is a transient variable?

  51. What is the difference between the '&' operator and the '&&' operator?

  52. Why main method of Java has public static void?

  53. If you have static block, constructor and main method in Java file then what will be the sequence of method calls?

  54. What are the command line arguments?

  55. Does Java support multi dimensional arrays?

  56. What are the restrictions for static method?

  57. Why a abstract method cannot be static?

  58. Is 'sizeof' a keyword?

  59. What is the precedence of operators in Java?

  60. How is an argument passed in Java methods?

  61. What is the difference between class variable, member variable and automatic(local) variable?

  62. When are static and non static variables of a class initialized?

  63. Can shift operators be applied to float types?

  64. What are different Java declarations and their associated rules?

  65. What are Java Modifiers?

  66. Explain final modifier.

  67. Can you change the reference of the final object?

  68. Can abstract class be instantiated?

  69. When does the compiler insist that the class must be abstract?

  70. Where can static modifiers be used?

  71. What is static initializer code?

  72. Can an anonymous class implement an interface and extend a class at the same time?

  73. What are volatile variables?

  74. Can protected or friendly features be accessed from different packages?

  75. How many ways can one write an infinite loop?

  76. When do you use 'continue' and 'break' statements?

  77. What is the difference between 'while' and 'do while' loop?

  78. What is an Assertion and why using assertion in your program is a good idea ?

  79. Explain Assertions with a code exmaple.

  80. How many forms of assertions we have?

  81. When assertions should be avoided?

  82. What situations are best suitable for implementing assertions?

  83. What is Exception ?

  84. What is a user-defined exception?

  85. What do you know about the garbage collector?

  86. Why Java does not support pointers?

  87. Does garbage collection guarantee that a program will not run out of memory?

  88. What is finally in Exception handling?

  89. What can prevent the execution of the code in finally block?

  90. Explain 'try','catch' and 'finally' blocks?

  91. Define Checked and Unchecked exception.

  92. What is the difference between an abstract class and an interface?

  93. What is the use of interface?

  94. What is serializable interface?

  95. Does a class inherit constructors from its superclass?

  96. What's the difference between constructors and other methods?

  97. If the method to be overridden has access type 'protected', can subclass have the access type as 'private'?

  98. If you use super() or this() in a constructor where should it appear in the constructor?

  99. What modifiers may be used with an inner class that is a member of an outer class?

  100. Can an inner class be defined inside a method?

  101. What is an anonymous class?

  102. What is a thread?

  103. What is the difference between process and threads?

  104. What are two types of multitasking?

  105. What are two ways of creating threads in Java and why so?

  106. How does multithreading take place on a computer with a single CPU?

  107. How a Java object be locked for exclusive use by a given thread?

  108. What is Synchronization?

  109. Explain wait(),notify(), and notifyAll() methods?

  110. What is a Daemon thread?

  111. How a dead thread can be started?

  112. What is the difference between String and StringBuffer?

  113. How is '==' different from .equals() method in case of String objects?

  114. Explain StreamTokenizer?

  115. What is Collection?

  116. Explain List,Set and Map.

  117. What is the serialization?

  118. What is the difference between Serializable and Externalizable interface?

  119. What is memory leak?

  120. Difference between ArrayList and Vector class?

  121. What is the difference between Hashtable and HashMap?

  122. What is JFC?

  123. What is the difference between JFC Swing and AWT?

  124. What is the base class for all swing components?

  125. What are lightweight and heavyweight components ?

  126. How can a GUI component handle its own events?

  127. What is a Layout Manager and what are its different types and their advantages?

  128. How are the elements of a GridBagLayout organized?

  129. What are the problems faced by Java programmers in absence of layout managers?

  130. Where the CardLayout is used?

  131. What is the difference between GridLayout and GridBagLayout?

  132. How will you add a panel to a frame?

  133. What is the difference between Application and Applet?

  134. Explain Lifecycle of the Applet and what is the order of method invocation in an applet?

  135. What is the difference between Java class and bean?

  136. What is difference between trusted and untrusted applet?

  137. How do you set Java Library path programmatically?

  138. Explain the usage of java.util.Date and more classes and APIs for date handling in Java?

  139. JDBC

  140. What is JDBC ?

  141. What are four drivers available in JDBC?

  142. How do you establish database connection using JDBC?

  143. How do you connect to a MySql Database using JDBC?

  144. What are the different types of Statements?

  145. What is PreparedStatement and how is different from Statement?

  146. What is the difference between executeQuery () and execute() ?

  147. What is the difference between executeQuery () and executeUpdate()?

  148. How do you call a stored procedure in Java?

  149. What are new features from JDBC2.0 onwards?

  150. How can a cursor move in scrollable result sets?


  152. How will you differentiate the following two ways of loading a database driver?

  153. How can you display a particular web page from an applet?

  154. How can you get the hostname on the basis of IP addres ?

  155. How can you get an IP address of a machine from its hostname?

  156. How do you know who is accessing your server?

  157. What are different socket options?

  158. What should I use a ServerSocket or DatagramSocket in my applications?


Sohan Chakraborty on February 6, 2008 at 7:53 PM said...


Dharm on May 13, 2008 at 5:46 AM said...

Thanks for your comment Sohan.

Sumith Puri on August 30, 2008 at 4:27 AM said...

Your java questions are one of the best list available on the net now. Thanks.

Anonymous said...

A very good compilation. Thanks a lot!

Anonymous said...


ToeNail on April 16, 2009 at 12:35 PM said...

I love your compilation of QnA!
Three cheers to your effort!

Now for the suggestions:
The pages takes aeons to load as there are a million links to other sites. The main matter of the page loads last, after the icons and images and what not have loaded.(It took me nearly 40 minutes to set a filter for these 'un-useful' things :P)
Also, every question opens in a new page.
Please fix these things.

Jasmine said...

Very useful set of questions and answers. Good deviation from the normal questions avaiable on the net.. :)

Vikrant on October 8, 2009 at 7:14 AM said...

Though not an expert in this field, but your research, & analysis is exhaustive & complete for a budding Java programmer ...Great Job..All the best.

Deepun on October 10, 2009 at 12:27 AM said...

Thanks for your encouraging comments Vikrant.

Anonymous said...

Yeah, AMAZING list! Thanks so much. You have pretty much covered everything!

Anonymous said...

Thanks for these useful questions

Anonymous said...

great job!! probably you should publish them as a booklet or something like that.

Javed on November 18, 2009 at 11:20 AM said...

Amazing! nice collection

Shunmuga on November 21, 2009 at 9:31 AM said...

Excellent. After reading this now i am very much confident. Thanks for your work you have done.

Anonymous said...

Good work mate!

Sanju on January 7, 2010 at 2:57 AM said...

Thanks much. Keep up the good work

namitha said...


Nomesh on March 1, 2010 at 2:45 AM said...

Good Work !! really Helpful. Thanks a lot.

Anonymous said...

Very good questions. I have never seen this many good questions in a single blog. nice job. keep it up mate...

Varun on April 11, 2010 at 12:49 PM said...

its superb collection.....
gr8 work...........

Manjula on May 13, 2010 at 6:45 PM said...

its an Excellent reference for java
easily understable and concrete.
Thanks a lot!!!

priya said...


Anonymous said...

1 hope these q&a are sufficient for freshers.... not for exp persons

Arun Kumar on June 4, 2010 at 7:34 AM said...

Excellent compilation of Java Q&A. one suggestion, please group the Q&A of particular topic in a single page.

for ex, jdbc Q&A can be in one single page, applets Q&A can be in another page

Thank you for such gud work

Anonymous said...

Such an interesting set of questions. Keep up the good work!

Anonymous said...

Excellently consolidated together...good wrk!!!

Anonymous said...

you are shining like a star. The best collection of question i found on the net

Anonymous said...

Very good set of questions !!

Anonymous said...


Its a great stuff before going to interview.Done a good job

Anonymous said...

nice work sir

Anonymous said...

Very nice compilation. Good Job and thanks

Anonymous said...

Super List of Questions

Dinesh on January 11, 2011 at 11:00 PM said...

Great great great.........!

Anonymous said...

Thanks a lot for your effort

Anonymous said...

Thanks. Appreciate your Effort...

sneha on May 7, 2011 at 9:48 PM said...

Thanks! it was very helpful

sneha on May 7, 2011 at 9:49 PM said...

Thanks! it was very helpful

sneha on May 7, 2011 at 9:49 PM said...

Thanks! it was very helpful

sneha on May 7, 2011 at 9:49 PM said...

Thanks! it was very helpful

Anonymous said...

thanks a lot for this compilation, its really very helpful

aarif on June 21, 2011 at 10:20 PM said...

i am speechless! great job!

Anonymous said...

its excellent really i liked it very much

Anonymous said...

Preety good collection of questions. .job done very well!!

G Suresh said...

U r the SAVIOUR Man!!!!! After a lot of searching i feel like i found the TREASURE finally.........ThanQ...Thanks a lot!!!!

Rajkiran on February 17, 2012 at 10:08 AM said...

great buddy very good collection.... :) keep rocking

Anonymous said...

I am still just half done, but felt like complementing on this set of questions. Great job. Also thanks for for answers to comments following the description. Please keep posting.

examinationtime on November 20, 2012 at 6:49 AM said...

Really, very good question list.

Anonymous said...

Very good blog post. I absolutely love this site. Keep it up!

Anonymous said...

Nice blog right here! Also your website loads
up fast! What web host are you the use of? Can I get your associate link
on your host? I wish my web site loaded up as fast as yours lol

Also visit my web blog ... "gradin"

Anonymous said...

Μу brother suggеsteԁ I might like thіs
web sitе. He wаs tоtаlly right.
Thіѕ put up truly maԁe my day.
You can not conѕider simply how much timе I had spent for this infο!
Thank you!

Feel free to visit my blog post Ameгicas Caгdroom Pοκer Offer []

java2novice on April 21, 2014 at 9:56 PM said...

very nice. for java examples, visit site

Abderrahmen on October 17, 2015 at 3:41 AM said...

Very interesting java programming course.
For more tutorials, check website.

Arpit Mandliya on July 26, 2017 at 5:52 AM said...

Good post,
Your post contains a lot of questions on Core Java. This list of questions is very useful for all Java students and Job seekers on Java profile. Your list covers interview questions from approx all topics of core Java. I think these questions are quite enough that will help people to crack Java interview. Thanks for sharing such a great list of Java interview questions. I also visited a blog (java2blog), which also provides a tutorial on Core Java, Hibernate, Spring, Angular JS, and having a good collection of Java interview questions with answers.


Interview Questions On Java,Java EE Copyright © 2017. Reads: best tracker