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