esasy
1. What is the difference between JDK and JRE?
esasy
2. What is JVM ? Why is Java called the “Platform Independent Programming Language” ?
esasy
3. What is JIT compiler?
esasy
4. Why java is not 100% Object-oriented?
esasy
5. What are the Data Types supported by Java ? What is Autoboxing and Unboxing ?
esasy
6. Why do we need a constructor in OOP?
esasy
7. What is the difference between an Interface and an Abstract class?
esasy
8. Why constructors can not be inherited in java?
esasy
9. What is the difference between processes and threads ?
esasy
10. What are the principle concepts of OOPS?
esasy
11. Explain the concept of Inheritance?
esasy
12. Explain different ways of creating a thread.Which one would you prefer and why ?
esasy
13. Explain the available thread states in a high-level.
esasy
14. What is the difference between a synchronized method and a synchronized block ?
esasy
15. How does thread synchronization occurs inside a monitor ? What levels of synchronization can you apply ?
medium
16. What’s a deadlock ?
medium
17. How do you ensure that N threads can access N resources without deadlock ?
medium
18. What is Collection ? What is a Collections Framework ? What are the benefits of Java Collections Framework ?
medium
19. What are the basic interfaces of Java Collections Framework ?
medium
20. What is different between Iterator and ListIterator?
medium
21. What are different ways to iterate over a list?
medium
22. How to convert an array of String to arraylist?
medium
23. How to reverse the list?
medium
24. What is an Iterator ?
medium
25. What differences exist between Iterator and ListIterator ?
medium
26. What is difference between fail-fast and fail-safe ?
medium
27. What differences exist between HashMap and Hashtable ?
medium
28. What is difference between Array and ArrayList ? When will you use Array over ArrayList ?
medium
29. What is Comparable and Comparator interface ?
medium
30. What is Java Priority Queue ?
medium
31. What do you know about the big-O notation and can you give some examples with respect to different data structures ?
medium
32. What are some of the best practices relating to the Java Collection framework ?
medium
33. What’s the difference between Enumeration and Iterator interfaces ?
medium
34. What is the difference between HashSet and TreeSet ?
medium
35. What is the purpose of garbage collection in Java, and when is it used ?
medium
36. What does System.gc() and Runtime.gc() methods do ?
medium
37. When is the finalize() called ? What is the purpose of finalization ?
medium
38. If an object reference is set to null, will the Garbage Collector immediately free the memory held by that object ?
medium
39. Does Garbage collection occur in permanent generation space in JVM ?
medium
40. What are the Exception Handling Keywords in Java?
medium
41. What is the purpose of the throw and throws keywords?
medium
42. What is the difference between final, finally and finalize in Java?
medium
43. What happens when an exception is thrown by the main method?
medium
44. What is a stacktrace and how does it relate to an exception?
medium
45. Can you throw any exception inside a lambda expression’s body?
medium
46. Explain java exception handling best practices
medium
47. What is the difference between Exception and Error in java ?
medium
48. What is the difference between throw and throws ?
medium
49. What is the importance of finally block in exception handling ?
medium
50. What will happen to the Exception object after exception handling ?
medium
51. What is the difference between abstraction and encapsulation?
medium
52. What is Abstraction?
medium
53. What is Encapsulation?
medium
54. What is Polymorphism?
medium
55. How does Java implement polymorphism?
medium
56. Explain the different forms of Polymorphism.
medium
57. How do you prevent a method from being overridden?
medium
58. Can we create an object for an interface?
medium
59. What is method overloading?
medium
60. What is super?
medium
61. When should I use abstract classes and when should I use interfaces?
medium
62. What are Access Specifiers available in Java?
medium
63. What is final modifier?
medium
64. What are the uses of final method?
medium
65. What is the difference between static and non-static variables?
medium
66. What are static methods?
hard
67. Why Collection interface does not extend Cloneable and Serializable interface?
hard
68. How HashMap works in Java?
hard
69. Is Java “pass-by-reference” or “pass-by-value”?
hard
70. What are different techniques for avoiding != null statements (Not Null Check)?
hard
71. Does “finally” always execute in Java?
hard
72. s it possible to break out of nested loops in Java?
hard
73. Why String is immutable in java?
hard
74. Why multiple inheritances are not supported in Java?
hard
75. Can we call static method with null object?
hard
76. How does volatile variable works in Java?
hard
77. What’s wrong using HashMap in the multi-threaded environment? When get() method go to the infinite loop?
hard
78. Can you write critical section code for the singleton?
hard
79. What is difference between Executor.submit() and Executer.execute() method ?
hard
80. What is the difference between creating String as new() and literal?
hard
81. Give the simplest way to find out the time a method takes for execution without using any profiling tool?
hard
82. What best practices you follow while writing multi-threaded code in Java?
hard
83. Tell me few best practices you apply while using Collections in Java?
hard
84. Can you tell us at least 5 best practice you use while using threads in Java?
hard
85. Name couple of method overloading best practices in Java?
hard
86. What method do you prefer to use when you are declaring a class in your Java code?
hard
87. Can you explain the method you use to keep your code organized so it's easy to work with?
hard
88. Is it possible to import same package or class twice? Will the JVM load the package twice at runtime?
hard
89. There are two objects – a and b – with the same hashcode. I will insert two objects inside the hashmap.
hard
90. How does the substring() method of String class create memory leaks?
hard
91. Why is Char array preferred over String to store a password?