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
Every Java journey starts with a class and a main method.
"Think of it as the mandatory doorway to your code."
The 'Containers' of Messages
Communicating with the Machine Console
print = Stay on line
println = Message + Enter
Predict the Output
A backslash changes the meaning of special characters in a string.
Predict the Visual Result
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.
Apply precedence and truncation
What is the result of:10 / 4 + 7 % 3 * 5
The machine simply skips them entirely.
Key takeaways from today's session
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.
double quotes.(8 + 2) / 3 * 29 / 2 - 5 % 3(7 + 4) / 3 + 16 * 3 / 5 + 1(9 - 1) % 5 / 2