Monday, 11 March 2024

Java interview question

 

Outline:

  1. What is Java?
  2. Explain the difference between JDK, JRE, and JVM.
  3. How does the ‘public static void main(String[] args)’ method work?
  4. What is bytecode in Java?
  5. Differentiate between overloading and overriding.
  6. What is the Java ClassLoader?
  7. Can we override the static method in Java?
  8. Describe the different access modifiers in Java.
  9. What is the difference between an abstract class and an interface?
  10. How does the ‘finally’ block differ from the ‘finalize’ method in Java?
  11. Explain the concept of Java packages.
  12. What are Java annotations?
  13. How does multi-threading work in Java?
  14. Explain the difference between throw and throws in Java.
  15. What is the significance of the transient keyword?
  16. How do you ensure thread safety in Java?
  17. Explain the Singleton pattern.
  18. What are Java Streams?
  19. What are the primary differences between ArrayList and LinkedList?
  20. How do HashSet, LinkedHashSet, and TreeSet differ?
  21. Differentiate between HashMap and ConcurrentHashMap.
  22. Describe the contract between hashCode() and equals() methods.
  23. What is Java reflection?
  24. How do you create a custom exception in Java?
  25. What is the difference between a checked and unchecked exception?
  26. What are generics? Why are they used?
  27. Explain the concept of Java Lambda Expressions.
  28. What is the diamond problem in inheritance?
  29. Describe the difference between fail-fast and fail-safe iterators.
  30. What is type erasure in Java generics?

No comments:

Post a Comment