Lessons

Java tutorial

Java Syntax

Java is case sensitive, so Main and main are different. Statements usually end with a semicolon, and braces group the statements that belong to a class or method.

Names you invent, such as price, start with a letter. The teaching runner ignores comments so you can leave notes in the sample.

Example

Edit the code and run it again. This runner stays in your browser and covers the syntax used in these lessons.

Output

Run the example to see output here.

What this code does

The program stores the whole number 12 in price and then prints that stored value. The comment is not printed.