Java Interview Questions

Anonymous User
3435
Jun 05, 2024

Java Technical Interview Questions

Core Java Concepts

    1. What is the difference between JDK and JRE?
    1. Why is Java a platform independent language?
    1. What is the difference between an abstract class and an interface?
    1. What is the difference between final, finally, and finalize?
    1. What is the difference between stack and heap memory?
    1. What is the difference between method overloading and method overriding?
    1. What is the difference between an abstract class and an interface?
    1. What is the difference between a private and a protected modifier?
    1. What is constructor overloading in Java?
    1. What is the use of super keyword in Java?
    1. What is the difference between static methods, static variables, and static classes in Java?
    1. What exactly is System.out.println in Java?
    1. What part of memory - Stack or Heap - is cleaned in the garbage collection process?

Object-Oriented Programming

    1. What are the Object Oriented Features supported by Java?
    1. What are the different access specifiers used in Java?
    1. What is the difference between composition and inheritance?
    1. What is the purpose of an abstract class?
    1. What are the differences between constructor and method of a class in Java?
    1. What is the diamond problem in Java and how is it solved?
    1. What is the difference between local and instance variables in Java?
    1. What is a Marker interface in Java?

Data Structures and Algorithms

    1. Why are strings immutable in Java?
    1. What is the difference between creating a String using new() and as a literal?
    1. What is the Collections framework?
    1. What is the difference between ArrayList and LinkedList?
    1. What is the difference between a HashMap and a TreeMap?
    1. What is the difference between a HashSet and a TreeSet?
    1. What is the difference between an Iterator and a ListIterator?
    1. What is the difference between an ArrayList and a LinkedList?
    1. What is the purpose of the Comparable interface?
    1. What is the difference between a HashSet and a TreeSet?
    1. What is the purpose of the java.util.concurrent package?

Exception Handling

    1. What is an exception?
    1. How does an exception propagate throughout the Java code?
    1. What is the difference between checked and unchecked exceptions?
    1. What is the use of try-catch block in Java?
    1. What is the difference between throw and throws?
    1. What is the use of the finally block?
    1. What’s the base class of all exception classes?
    1. What is Java Enterprise Edition (Java EE)?
    1. What is the difference between a Servlet and a JSP?
  • 10.What is the purpose of the Java Persistence API (JPA)?
  • 11.What is the difference between stateful and stateless session beans?

Multithreading

    1. What is a thread and what are the different stages in its lifecycle?
    1. What is the difference between process and thread?
    1. What are the different types of thread priorities available in Java?
    1. What is context switching in Java?
    1. What is the difference between user threads and Daemon threads?
    1. What is synchronization?
    1. What is a deadlock?
    1. What is the use of the wait() and notify() methods?
    1. What is the difference between a thread and a process in Java?
    1. What is the difference between synchronized and volatile in Java?
  • 11.What is the purpose of the sleep() method in Java?
  • 12.What is the difference between wait() and sleep() in Java?
  • 13.What is the difference between notify() and notifyAll() in Java?
Comments (1)