This cheat sheet contains important takeaways that lead up to section two.
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 (we didn't cover
long can store very big numbers. But,
int is faster and takes less memory.
nextLine(): scans for a
nextDouble(): scans for a
nextLong(): scans for a
nextInt(): scans for an
Put math operations in brackets if you wish to embed them inside a
"5 + 2 is " + (5 + 2);
|Solution||Add a throwaway |
|Explanation||The upcoming lesson on Delimiters will explain why this happens.|
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.