Java interview question
Outline:
- What is Java?
- Explain the difference between JDK, JRE, and JVM.
- How does the ‘public static void main(String[] args)’ method work?
- What is bytecode in Java?
- Differentiate between overloading and overriding.
- What is the Java ClassLoader?
- Can we override the
static method in Java? - Describe the different access modifiers in Java.
- What is the difference between an abstract class and an interface?
- How does the ‘finally’ block differ from the ‘finalize’ method in Java?
- Explain the concept of Java packages.
- What are Java annotations?
- How does multi-threading work in Java?
- Explain the difference between
throw and throws in Java. - What is the significance of the
transient keyword? - How do you ensure thread safety in Java?
- Explain the Singleton pattern.
- What are Java Streams?
- What are the primary differences between
ArrayList and LinkedList? - How do
HashSet, LinkedHashSet, and TreeSet differ? - Differentiate between
HashMap and ConcurrentHashMap. - Describe the contract between
hashCode() and equals() methods. - What is Java reflection?
- How do you create a custom exception in Java?
- What is the difference between a checked and unchecked exception?
- What are generics? Why are they used?
- Explain the concept of Java Lambda Expressions.
- What is the diamond problem in inheritance?
- Describe the difference between
fail-fast and fail-safe iterators. - What is type erasure in Java generics?
No comments:
Post a Comment