Exams Attended

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

  Difficulty Level: AllBeginnerIntermediateExperienced/Expert

Ques 1. What is phantom memory?

Ques 2. How can I swap two variables without using a third variable?

Ques 3. Explain working of Java Virtual Machine (JVM)?

Ques 4. Why String is immutable or final in Java?

Ques 5. In Java, you can create a String object as below : String str = "abc"; & String str = new String("abc");  Why cant a button object be created as : Button bt = "abc"? Why is it compulsory to create a button object as: Button bt = new Button("abc"); Why this is not compulsory in String's case?

Ques 6. Can you call one constructor from another if a class has multiple constructors?

Ques 7. What are some alternatives to inheritance?

Ques 8. When can an object reference be cast to an interface reference?

Ques 9. What is the algorithm used in Thread scheduling?

Ques 10. What are the threads will start, when you start the java program?

Ques 11. What are the approaches that you will follow for making a program very efficient?

Ques 12. What is an object's lock and which object's have locks?

Ques 13. There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it?

Ques 14. What is hash-collision in Hashtable and how it is handled in Java?

Ques 15. Can an inner class declared inside of a method access local variables of this method?

Ques 16. When you think about optimization, what is the best way to findout the time/memory consuming process?

Ques 17. How do I convert a numeric IP address like 192.18.97.39 into a hostname like java.sun.com?

Ques 18. What is the advantage of the event-delegation model over the earlier event-inheritance model?

Ques 19. Does JVM maintain a cache by itself? Does the JVM allocate objects in heap? Is this the OS heap or the heap maintained by the JVM? Why?

Ques 20. What is reflection API? How are they implemented?

Ques 21. What is dead lock in thread?

Ques 22. When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in Java?

Ques 23. What is thread pool in java?

Ques 24. What is concurrency in java?

Ques 25. What is reason of NoClassDefFoundError in Java?

Ques 26. How to resolve NoClassDefFoundError?

Ques 27. Difference between ClassNotFoundException and NoClassDefFoundError in Java?

Ques 28. What is java.lang.OutOfMemoryError in Java?

Ques 29. Types of OutOfMemoryError in Java.

Ques 30. Difference between "java.lang.OutOfMemoryError: Java heap space" and "java.lang.OutOfMemoryError: PermGen space"

Ques 31. How HashMap works in Java?

Ques 32. What is the difference between Synchronized Collection classes and Concurrent Collection Classes ? When to use what ?

Ques 33. How to use Comparator and Comparable in Java? With example.

Ques 34. What is Dictionary Class in Java?

Ques 35. What is Reference Handler Thread in Java?

Ques 36. What is Main thread in Java?

Ques 37. What is Signal Dispatcher thread in Java?

©2022 WithoutBook