CS With NehalCS With Nehal

Java Learning Lab

Learn Java from zero to exam-ready: 15 topics with step-by-step visualizations, practice problems, a code lab and mock midterm and final papers.

Interactive Java Learning Lab

Lessons with step-by-step visualizations, long-form practice problems, a Java code lab and timed mock midterm and final papers. Everything runs in your browser.

Topics

  1. Flowcharts: Read any flowchart and turn it into a complete Java program.
  2. Variables & Data Types: Choose the right type, declare it correctly and predict every cast.
  3. Operators & Expressions: Evaluate any expression by hand - precedence, integer division, %, ++ and --.
  4. User Input with Scanner: Read ints, doubles, words and lines without falling into the nextLine trap.
  5. Decision Making: Turn a word problem into if / else-if / switch logic that handles every case.
  6. Loops: Write while, do-while and for loops, and control them with break and continue.
  7. Nested Loops & Patterns: Reason about an inner loop that restarts for every outer iteration.
  8. Digit Processing & Checksums: Peel digits with % and /, rebuild numbers, and solve checksum problems.
  9. Tracing & Trace Tables: Fill an exam trace table with one row per iteration and the exact output.
  10. Strings: Scan, compare and build Strings character by character.
  11. Arrays: Create, traverse, search and aggregate arrays - and understand references.
  12. Building New Arrays: Filter, partition, rotate and de-duplicate into a new array while keeping order.
  13. Sorting & Searching: Trace and write selection sort and bubble sort, and search an array.
  14. Methods: Split a problem into methods with parameters and return values.
  15. Recursion & Recursion Tracing: Trace a call stack down to the base case and back up, in exact output order.

Loading the lab…

About This Simulation

The Java Learning Lab takes you from your first program to exam-ready. It has 15 topics with step-by-step visualisations of how code runs, long-form practice problems, a code lab and timed mock midterm and final papers, all in your browser.

Features

  • 15 topics from variables to recursion
  • Step-by-step visualisation of code execution and memory
  • Practice problems with worked solutions
  • A Java code lab to write and run your own programs
  • Timed mock midterm and final papers
  • Progress saved in your browser

Topics covered

  • Java Programming
  • Variables and Data Types
  • Conditionals and Loops
  • Arrays and Strings
  • Methods
  • Recursion

Explanation

Learning to program means learning to predict exactly what the computer will do with each line of code. This lab shows the state of variables and memory after every line, so you build an accurate mental model before writing your own programs.

How it works

  1. Pick a topic from the Learn section and read the short explanation.
  2. Step through the example programs and watch the variables change line by line.
  3. Solve the practice problems for that topic, then check the solutions.
  4. Write and run your own code in the code lab.
  5. Before an exam, take a timed mock midterm or final paper.

Why it matters

Java is the first language in many university courses, including CSE110 at BRAC University. Tracing code by hand and writing loops, methods and array programs are exactly what introductory programming exams test.

Frequently Asked Questions

Is this Java course suitable for complete beginners?

Yes. It starts with variables, input and output, then builds up through conditionals, loops, strings, arrays and methods to recursion.

Do I need to install Java to use the lab?

No. Everything, including the code lab, runs in your web browser.

How should I prepare for a Java programming exam?

Trace short programs by hand until you can predict the output, practise writing loops and array problems without help, then take a timed mock paper to practise under exam conditions.

What is the difference between a while loop and a for loop in Java?

A for loop keeps the initialisation, condition and update in one line and is used when the number of iterations is known. A while loop only has a condition and is used when you loop until something happens.

Related Simulations

Acknowledgements

The Person Behind This Simulation

This simulation would not have been possible without his valuable contributions and support. We sincerely appreciate his time, effort, and dedication to the project.

Sifat Sadakin

Sifat Sadakin

  • Undergraduate Research Assistant | BRAC University
  • Undergraduate Teaching Assistant at OAA (Office of Academic Advising) | BRAC University
  • First Year Advising Team (FYAT) Mentor | BRAC University