This cheat sheet contains takeaways leading up to section three.
1. Getting Started
class: contains all of your code.
main(): entry point of your app.
javac <file-name>.java: compiles your code.
java <file-name>: runs the compiled code.
There are 6 main data types.
long can store very big numbers. But,
int is faster and takes less memory.
Put math operations in brackets if you wish to embed them inside a
"5 + 2 is " + (5 + 2);
3. Booleans and Conditionals
Put comparison operations in brackets if you wish to embed them inside a
"Five is not smaller than one. I'm certain this is " + (5 < 1);
Rules of thumb
When controlling how your code runs:
switchto compare one value against a list of values.
in any other scenario, use
Do not confuse
=to set a value equal to another.
==to compare two values and return a
The default delimiter is white space.
Good coding habits
Tips and tricks
Use the up key to run previous terminal commands.
clearto clear the terminal output.
tabkey for auto-complete.
\nadds a new line of space.
\tadds a new tab of space.
/to comment a highlighted piece of code.
In Visual Studio Code, use
sysoutas a shortcut to