Build typed programs with classes, collections and the Java runtime.

Before starting: Basic terminal use and a JDK installation.

Practice project: Build a reading-list application with classes, collections, and tests.

1. Java Fundamentals & Architecture

  1. Java Introduction, JVM Architecture & Bytecode
  2. Java Syntax, Class Structure & Statement Rules
  3. Variables, Memory & 8 Primitive Data Types
  4. Type Casting: Widening vs Narrowing Conversions
  5. Operators: Arithmetic, Relational, Logical & Bitwise
  6. User Input: Scanner Class & Console Interaction
  7. Math Class, Random Numbers & Constants (final)

2. Control Flow & Decision Making

  1. Conditional Logic: if, else if & else Branching
  2. Ternary Operator: Compact Inline Decision Making
  3. Switch Statements & Enhanced Switch Expressions (->)
  4. While & Do-While Loops: Indefinite Iteration
  5. Standard For Loops & Nested Matrix Iteration
  6. Loop Control: break, continue & Labeled Loops

3. Arrays & Strings

  1. One-Dimensional Arrays: Declaration, Memory & Indexing
  2. Multidimensional & Jagged Arrays
  3. Enhanced For-Each Loop: Clean Traversal
  4. String Immutability & The String Constant Pool
  5. Essential String Methods & Text Manipulation
  6. StringBuilder vs StringBuffer: High-Performance Concatenation

4. Methods, Scope & Modular Code

  1. Method Declarations, Parameters & Return Types
  2. Method Overloading & Compile-Time Polymorphism
  3. Recursion: Base Cases & Call Stack Mechanics
  4. Variable Arguments (Varargs): Type... Parameter Syntax
  5. Packages & Imports: Project Organization & Namespaces
  6. Access Modifiers: public, protected, default & private

5. Object-Oriented Programming (OOP) Core

  1. Classes, Objects & Heap Memory Allocation
  2. Constructors: Default, Parameterized & Overloading
  3. The this Keyword & Explicit Constructor Chaining
  4. Encapsulation: Data Hiding & Getters / Setters
  5. Inheritance: extends Keyword & IS-A Hierarchy
  6. The super Keyword: Parent Constructors & Methods
  7. Polymorphism, Method Overriding (@Override) & Dynamic Dispatch
  8. Abstraction & Abstract Classes: Partial Blueprints

6. Interfaces, Advanced OOP & Type System

  1. Interfaces & Multiple Interface Inheritance
  2. Default, Static & Private Interface Methods
  3. Enum Types: Type-Safe Constants, Fields & Methods
  4. Inner Classes, Static Nested Classes & Anonymous Classes
  5. Wrapper Classes, Autoboxing & Unboxing
  6. Modern Java Records: Immutable Data Carriers

7. Collections Framework & Generics

  1. Generics: Parameterized Types, Type Safety & Wildcards
  2. Java Collections Framework: Hierarchy & Selection
  3. ArrayList<E>: Dynamic Resizable Arrays & Operations
  4. LinkedList<E>: Doubly-Linked Nodes & Deque Operations
  5. HashSet<E>: Uniqueness, Hash Codes & equals() Contract
  6. HashMap<K, V>: Key-Value Bucketing & O(1) Lookups
  7. Iterators, Comparable & Comparator Sorting

8. Exceptions, File I/O & Modern Java

  1. Exception Hierarchy: Checked vs Unchecked & try-catch-finally
  2. Try-With-Resources & AutoCloseable Management
  3. Custom Exceptions: throw & throws Declarations
  4. File I/O: NIO.2 Files, Path & Character Streams
  5. Lambda Expressions & Functional Interfaces
  6. Stream API: Pipelines, Filtering, Mapping & Reductions

Trace changing state and check loop boundaries

A trace table records the state after each statement. It helps distinguish an incorrect algorithm from a syntax mistake. Write the input contract first: this example accepts a list of numbers and returns their sum. The initial total is zero, so an empty list returns zero.

Paper trace first; pseudocode is not executable. Use your chosen language compiler or interpreter for the implementation.

PSEUDOCODE — translate before running
total ← 0
FOR EACH value IN values
    total ← total + value
RETURN total
Check the output
[2, -1, 4] → 5
[] → 0
[7] → 7
The loop must process each element exactly once.

Trace [-3, 3] without running code. Then implement and test it. Explain why starting at the second element loses data. Reject non-number input or explicitly document that it is outside the input contract.

Make a small learning project reproducible

A project is reproducible when another learner can obtain the same inputs, install the required tools, and repeat your checks. Record the tool versions and exact run commands. Use synthetic or permission-cleared sample data. Keep credentials outside the repository. A successful run on your laptop is a starting point; a fresh environment is a better check.

Any language; choose the package and build tools appropriate to that course

study-project/
  README.md          # setup, run, test, expected result
  src/               # your implementation
  tests/             # behavior checks
  data/              # small synthetic example data
  .gitignore         # caches, build output, local secrets
Check the output
This is a suggested directory layout, not a command to execute. Adapt conventions to the chosen language.

Build a score summarizer. Include an empty-input test, a malformed-input test, and one example whose answer can be calculated by hand.

Check a Java calculation with known answers

A small calculation can be checked without a testing library. Keep a normal case and an empty case with known answers. Throwing AssertionError here makes a failed check visible and gives the process an unsuccessful result. These explicit checks do not depend on Java assertions being enabled.

JDK with javac and java; no test library required

public class ScoreCheck {
    static int total(int[] values) {
        int sum = 0;
        for (int value : values) sum += value;
        return sum;
    }

    public static void main(String[] args) {
        if (total(new int[]{4, 6}) != 10) throw new AssertionError("normal case");
        if (total(new int[]{}) != 0) throw new AssertionError("empty case");
        System.out.println("Checks passed");
    }
}
Check the output
Checks passed

Add a negative-number case. Decide whether integer overflow should be rejected or documented for this function.

Open the Java learning path on DevStudyHub · Play coding games on this blog

logoblog

No comments:

Post a Comment

Please do not enter any spam link in the comment box.