Module 02
Core Java & OOP
Object-oriented Java from the ground up: classes, constructors, inheritance, interfaces, the Object contract, records, enums, Optional, functional basics, modern syntax and reflection, plus Strings and exceptions in depth.
By the end of this module you can
- Explain how objects are created, initialised and laid out, and what this and super really do
- Choose between inheritance, composition and interfaces, and defend the choice in a design round
- Implement equals(), hashCode() and deep copies correctly, and use records, enums and Optional the way they were designed
- Read and write modern Java: sealed types, pattern matching for switch and functional interfaces
Classes & objects
What a class and an object really are, constructors, every way to create an object, and the this keyword.
Inheritance & polymorphism
Extending classes, super, overloading vs overriding, casting objects and instanceof.
Abstract classes & interfaces
Abstract classes, interfaces, default and static methods, and sealed hierarchies.
Object relationships
Is-a vs has-a, and association, aggregation and composition in real designs.
static, final & transient
The three modifiers that change how members live, change and get serialised.
The Object contract
Comparing objects, the equals() and hashCode() contracts, and copying objects safely.
Records, enums & Optional
Java's data carriers, type-safe constants and the right way to say "maybe absent".
Functional Java basics
Functional interfaces, callbacks and functional programming style in Java.
Modern Java syntax
Pattern matching for switch, and compact source files with instance main methods.
Reflection & annotations
Inspecting and invoking code at runtime, annotations, and how frameworks use both.
Strings in depth
Immutability, the string pool, builders and compact strings.
Exceptions
How exceptions work under the hood and how to use them well.
Nested types
Inner, static nested, local and anonymous classes.
Module interview question bank
Finish the module
Module interview question bankEvery interview question worth practising for Core Java & OOP, grouped by topic, with model answers, how to say them and what-if follow-ups.