Interview Q&A · Java
Java Interview Questions & Answers
All 240 Core Java interview questions — basics, OOP, exceptions, threads, collections and serialization — rewritten with correct, up-to-date answers. This bank holds 294 questions across 56 topics and 12 topic groups. Every answer is written for current Java versions, and each topic links to matching course lessons where they exist.
Every topic below links to its own page with all of its questions in one place.
Answers are checked against current language behaviour; old-guide claims are corrected.
Each topic points to the matching course lesson, and lessons point back here.
Featured questions in this bank
Java Basics: Classes, Objects & Platform
Why is Java platform independent?
Java source is compiled to a machine-independent intermediate format called bytecode, not to native machine code. Any device with a Java Virtual Machine (JVM) can execute that same bytecode, so the compiled artifact does not…
Read the full answer →Java Basics: Classes, Objects & Platform
What is a class?
A class is a blueprint or template that defines the state (fields) and behaviour (methods) shared by a set of objects. It declares what data an object of that type holds and what operations it supports. In Java every piece of…
Read the full answer →Constructors: Rules, Types & Chaining
How do you call one constructor from another constructor?
Use this(...) with the matching argument list. It must be the very first statement of the constructor, and a constructor can only make one such call — so this(...) and super(...) can never appear together in the same constructor.
Read the full answer →Constructors: Rules, Types & Chaining
What is a constructor in Java?
A constructor is a special block that runs automatically when an object is created with new, initialising its fields. It has exactly the class name and no return type — not even void. A class may declare several constructors…
Read the full answer →Java Coding Standards & Naming Conventions
What are the Java coding standards for classes?
Class names are nouns in UpperCamelCase, starting with an uppercase letter, with each inner word capitalised. A source file containing a public class must be named after it, and one top-level public class per file is the rule.…
Read the full answer →Java Coding Standards & Naming Conventions
What are the Java coding standards for interfaces?
Interface names use the same UpperCamelCase as classes and are usually adjectives describing a capability — Runnable, Serializable, Comparable, Cloneable. Marker interfaces (no methods) like Serializable and functional interfaces…
Read the full answer →Core Java Basics
29 questions across 6 topics — Classes, objects, the JVM, bytecode and how Java represents text.
Methods & Constructors
18 questions across 4 topics — Constructors, this/super, overloading vs overriding and static members.
Coding Standards
7 questions across 1 topic — Naming conventions for classes, interfaces, methods, variables and constants.
OOP Mechanics
28 questions across 6 topics — IS-A/HAS-A, instanceof, packages, access modifiers, final and abstract types.
Exception Handling
34 questions across 6 topics — try/catch/finally, checked vs unchecked, throw/throws and custom exceptions.
Threads & Concurrency
54 questions across 7 topics — Thread lifecycle, synchronization, wait/notify, priorities and daemon threads.
Nested & Inner Classes
15 questions across 3 topics — Static nested, member, local and anonymous inner classes.
Objects, References & Memory
26 questions across 6 topics — References, garbage collection, wrappers, conversion, scope and classpath.
Interfaces, Enums & Features
18 questions across 4 topics — Modern interfaces, enums, field hiding, varargs and switch on strings.
OOP Concepts
13 questions across 3 topics — Procedural vs OOP, the four pillars, inheritance, polymorphism and covariant returns.
Collections Framework
41 questions across 9 topics — List, Set, Map, iterators, Hashtable vs HashMap and concurrent collections.
Serialization
11 questions across 1 topic — Serializable, serialVersionUID, transient fields and alternatives.
Recommended resourcesAffiliate links · may earn us a commission