Since Java is object-oriented, programs are organized into modules called classes, which may have data in variables and functions called methods. |
class HelloWorld |
{ public static void main (String[] args ) |
{ System.out.println("HelloWorld"); |
} |
} |
Each program is enclosed in a class definition |
main() is first routine that is run |
Syntax is similar to C |
Use braces for brackets and |
semicolons after each statement |
Upper and lower case matter! |
This notation is |
Package.class.method and is |
used to refer to public methods in other classes |
use class.method if package included |
some classes can be accessed automatically |