6 topics · 0/6 read
Core Java & OOP
JDK, JRE and JVM, the four OOP pillars, String immutability and the string pool, equals and hashCode, exceptions, and static, final, abstract classes and interfaces.
JDK vs JRE vs JVM and How Java Runs
JDK, JRE and JVM is the opening question of most Java interviews. The JDK is the toolkit to build Java programs, the JRE was the runtime to run them, and the JVM is the virtual machine that loads bytecode and runs it wit
Read nowOOP in Java: Encapsulation, Inheritance, Polymorphism, Abstraction
The four OOP pillars in Java are encapsulation, inheritance, polymorphism and abstraction. Interviewers want each explained with code, plus overloading vs overriding and composition over inheritance.
Read nowString Immutability, the String Pool and StringBuilder
Strings in Java are immutable and literals are stored in the string pool. Questions about == vs equals, why String is immutable and when to use StringBuilder appear in nearly every Java interview.
Read nowThe equals and hashCode Contract
If two objects are equal, they must have the same hashCode. Breaking the equals and hashCode contract makes HashMap and HashSet lose your objects, which is why interviewers always ask about it.
Read nowExceptions: Checked vs Unchecked and Best Practices
Java exceptions are split into checked exceptions the compiler forces you to handle and unchecked runtime exceptions. Interviewers ask about the hierarchy, try-with-resources, finally, and how exceptions should be handle
Read nowstatic, final, Abstract Classes and Interfaces
Keywords like static and final, and the choice between abstract classes and interfaces, are classic Java interview questions. Modern interfaces with default, static and private methods have changed the answer.
Read now