Basic Java Language: Difference between revisions

wikademia>Historybuff
→Touch on Classes: elaborate on braces
wikademia>Historybuff
m →Statements: calculations -> operations - might confuse people who are thinking math
Line 56: Line 56:


=Statements=
=Statements=
All calculations are done in statements. Every statement ends in a semicolon: ;. Statements can set a variable with the '=' operator. This sets the variable you wish to set to another variable or a value. Values can only be used on primitive types.  As you saw in the HelloWorld program, there was one statement: <code>System.out.println("Hello, World")</code>. This is one type of statement called calling a method. More will be discussed later. Finally, you can declare a variable. If a class has no statements, it would do nothing.
All operations are done in statements. Every statement ends in a semicolon: ;. Statements can set a variable with the '=' operator. This sets the variable you wish to set to another variable or a value. Values can only be used on primitive types.  As you saw in the HelloWorld program, there was one statement: <code>System.out.println("Hello, World")</code>. This is one type of statement called "calling a method". More will be discussed later. Finally, you can declare a variable. If a class has no statements, it would do nothing.


=Variables=
=Variables=