Basic Java Class structure
Storage
Much like math class, we use variables to store values. Now in math class we are only ever storing numbers (integers, decimals, fractions, etc.). This would work fine for storing someone's age (an integer). But to store that persons name we need letters of the alphabet.
Variable Names
You can't just give any name you want to a variable! Here are the rules to follow:
Variable names must start with either an upper or lowercase letter
A variable name may contain numbers or an underscore (ex: number_1)
You cannot use one of the reserved keywords (see D2L for a list)
Variable names should be camelCase (firstName, dayOfWeek, etc.)
Output
You can print words to the screen by putting a print command inside the main method
System.out.println("text");
Use the concatenation symbol + to print variables and Strings together:
System.out.println("Your number is " + x);