25 basic interview questions.
- Why java is a platform-independent language?
- What is Data Encapsulation?
- What is a JIT compiler?
- Why Java doesn't use pointers?
- Why Java is not a pure object-oriented language?
- What is the difference b/w the instance variable and a local variable?
- What is the difference between b/w equals() and equality operator (==)?
- How is method overloading different from overriding?
- Can be declared a single try block with multiple catch blocks?
- Why do we use the final keyword in a variable, method, and class?
- Can be declared an infinite loop in java?
- What is the difference b/w Array and ArrayList?
- How is HashSet different from TreeSet?
- What do you mean by Constructor Overloading?
- What is the difference b/w JVM, JRE, and JDK?
- What is the difference b/w the String, StringBuffer, and StringBuilder?
- In Java static and private method overriding possible?
- What is the difference b/w HashMap and HashTable in Java?
- How constructor different from the method in Java?
- What is synchronization in Java? Explain with an example.
- How interfaces and abstract classes are different?
- What is the reason behind making String immutable in Java?
- To store confidential information Character Array or String is preferred?
- How Java thread lifecycle works?
- Why it is said that the length() method of the String class does not return an accurate length?
These questions will help you prepare for Java interviews.
Thanks for Reading !!!