Master the core of Java, from logical steps to machine execution.
Can you guide the robot to its morning coffee?
Add steps to your algorithm.
Algorithm is empty.
Select commands to start.
A precise, step-by-step procedure for solving a specific task.
A translator can turn unfamiliar signals into a shared language.
The Compiler translates human Java code into machine instructions.
01101001
11001110
10101011
00000001
11110000
10101010
01010101
11001100
10001000
01110111
Even the best programmers make mistakes — the key is knowing what kind.
Every bug you meet will be one of these three.
Read each scenario — can you spot which error type it is?
Every Java journey starts with a class and a main method.
;() cause errors. ;The 'Containers' of Messages
Communicating with the Machine Console
print = Stay on line
println = Message + Enter
Trace the output
A backslash changes the meaning of special characters in a string.
Predict or construct the correct output
Snacks, discounts, and leftovers can all change the final basket.
The Building Blocks of Java Calculation
() are always evaluated first. *, /, and % have higher priority. + and - are performed last. Press Next to evaluate one rule at a time.
Integer Division Playground
In Java, dividing two integers always results in an integer.
Precedence, integer division & more
The machine simply skips them entirely.
Key takeaways from today's session
Syntax = compilation fails, Logic = wrong result, Runtime = crash during execution.
Every program needs a class and a main method to run.
print stays on the same line, while println adds a new line after.
Use \n for new lines and \" to print double quotes inside strings.
Dividing two ints always truncates (drops the decimal). example: 5 / 2 = 2.
Use // for single-line and /* */ for multi-line notes — ignored by the compiler, essential for humans.