Skip to content
InterviewEra
Loading account navigation
InterviewEra

InterviewEra is an AI-powered mock interview platform with adaptive follow-ups, resume-aware scoring, and structured interview preparation for campus placements and early-career hiring.

Start Mock Interview

Product

  • How It Works
  • For Teams
  • Start Mock Interview
  • Campus Placements
  • Campus Workspace
  • Help Center

Tools

  • Interview Question Generator
  • ATS Resume Checker
  • STAR Answer Builder

Resources

  • Interview Questions
  • All Resources
  • Blog
  • Community Hub
  • DSA Topic Map
  • Placement Guide
  • STAR Guide

Company

  • What is InterviewEra
  • About Us
  • Pricing
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy

© 2026 InterviewEra. All rights reserved.

Privacy Policy|Terms & Conditions|Refund Policy
|Ranchi, Jharkhand, India
Interview Questions›Topics›Java

Backend · Fresher-relevant

Java Interview Questions 2026

Core Java interview questions on OOPs, collections, multithreading, JVM internals, and exception handling — the primary language tested by TCS, Infosys, and Wipro.

BackendFresher-relevant

Java Interview Questions

Placement-oriented · Updated 2026
  1. 01

    What is the difference between == and .equals() in Java?

    TechnicalEasy

    Tip: == compares references (whether two variables point to the same object), while .equals() compares logical value. For String literals interned in the string pool == may appear to work, but always use .equals() for content comparison. Override equals() and hashCode() together for custom classes.

  2. 02

    Explain the Java memory model: stack vs heap.

    TechnicalMedium

    Tip: The stack stores method frames, local primitives, and object references — it is per-thread and freed when a method returns. The heap stores all objects and is shared across threads and managed by the garbage collector. Class metadata lives in the Metaspace (post-Java 8, replacing PermGen).

  3. 03

    What is the difference between HashMap, HashTable, and ConcurrentHashMap?

    TechnicalMedium

    Tip: HashMap is unsynchronised and allows one null key. HashTable is fully synchronised (legacy, slow) and disallows nulls. ConcurrentHashMap uses bucket/segment-level locking (CAS + synchronized bins since Java 8) for high-concurrency reads/writes without locking the whole map — prefer it over HashTable.

  4. 04

    What are the four pillars of OOP and how does Java implement each?

    TechnicalEasy

    Tip: Encapsulation (private fields + getters/setters), Inheritance (extends, single class inheritance), Polymorphism (method overriding + dynamic dispatch, overloading at compile time), and Abstraction (abstract classes and interfaces). Mention that Java supports multiple interface inheritance but single class inheritance.

  5. 05

    What is the difference between an abstract class and an interface?

    TechnicalMedium

    Tip: An abstract class can hold state (fields), constructors, and a mix of concrete and abstract methods; a class extends only one. An interface defines a contract — since Java 8 it can have default and static methods, and a class can implement many. Use an interface for "can-do" capabilities, an abstract class for shared base state.

  6. 06

    How does garbage collection work in Java? What is a memory leak in a GC language?

    TechnicalHard

    Tip: GC reclaims unreachable objects using generational collection (Young/Eden + Survivor, then Old gen). Algorithms include G1 (default since Java 9) and ZGC for low pause times. A leak still occurs when objects remain reachable but are no longer needed — e.g. static collections, unremoved listeners, or unclosed resources holding references.

  7. 07

    What is the difference between checked and unchecked exceptions?

    TechnicalEasy

    Tip: Checked exceptions (extend Exception) must be declared or handled at compile time — e.g. IOException. Unchecked exceptions (extend RuntimeException) signal programming errors like NullPointerException and need not be declared. Do not swallow exceptions; either handle meaningfully or propagate.

  8. 08

    Explain the volatile keyword and the difference between volatile and synchronized.

    TechnicalHard

    Tip: volatile guarantees visibility — reads/writes go to main memory, preventing stale cached values — but not atomicity. synchronized provides both mutual exclusion (atomicity) and visibility via the happens-before relationship. Use volatile for simple flags; use synchronized or AtomicInteger for compound read-modify-write operations.

Practice Java questions with your own resume

InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.

Start free mock interviewFree question generator

Roles that need Java

  • Software Engineer questions
  • Java Developer questions
  • Backend Developer questions
  • Android Developer questions

Related backend topics

  • Python questions
  • Node.js questions
  • REST APIs questions
  • Spring Boot questions
  • Django questions

Practice tools

  • Interview question generator
  • ATS resume checker
  • STAR answer builder

Guides and resources

  • All interview questions
  • HR interview answer tips
  • STAR method with examples