The main() method is required. Any code inside the main() method will be executed.
Inside the main() method, we can use the println() method to print a line of text to the screen. The curly braces {} marks the beginning and the end of a block of code.
System is a built-in Java class that contains useful members, such as out, which is short for "output".
The println() method, short for "print line", is used to print a value to the screen (or a file). There is also a print() method, which is similar to println(). The only difference is that it does not insert a new line at the end of the output
each code statement must end with a semicolon (;).
unlike text, we don't put numbers inside double quotes You can also perform mathematical calculations inside the println() method
Single-line comments start with two forward slashes (//). Multi-line comments start with /* and ends with */.
Variables are containers for storing data values.
String - stores text, such as "Hello". String values are surrounded by double quotes int - stores integers (whole numbers), without decimals, such as 123 or -123 float - stores floating point numbers, with decimals, such as 19.99 or -19.99 char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes boolean - stores values with two states: true or false
Note that if you assign a new value to an existing variable, it will overwrite the previous value If you don't want others (or yourself) to overwrite existing values, use the final keyword (this will declare the variable as "final" or "constant", which means unchangeable and read-only)