Back to blog

2022-09-24

My Early Java Exercises

A collection of small Java programs I wrote while learning programming fundamentals.

The Goal

While learning Java, most of my practice came from writing many small programs. Each file focused on one concept so I could understand it clearly.

Instead of building one large project, I built many small experiments.

My Java Exercise Folder

Most of these files were saved in a Google Drive folder.

My Java files in Google Drive

Looking at the filenames now shows the topics I was learning.

Some Example Programs

Some of the exercises in that folder:

  • operators.java – arithmetic and logical operators
  • ifelse.java – basic conditional statements
  • elseif.java – multiple decision paths
  • nestedelseif.java – nested conditional logic
  • SWITCH.java – switch statements
  • comparisonandlogical.java – combining logical conditions
  • Increment.java – increment operators

There were also slightly larger programs:

  • guessingGame.java – a simple number guessing game
  • Calculator.java – a basic calculator program

Each file was a small experiment.

What I Learned

These exercises helped me understand core programming concepts.

Control Flow
Programs make decisions using if, else, and switch.

Operators
Programs perform calculations and comparisons.

Learning Through Small Programs
Writing many small programs made learning easier.

Looking Back

Most of these files lived in Google Drive instead of a proper repository.

If I started again, I would:

  • store everything in Git
  • organize exercises by topic
  • keep notes about what each program teaches

Still, these small programs built the foundation for everything I learned later.