|
Java Tutorial |
ClassThese pages make up the course notes for my Java programming course (run at Dallam, Milnthorpe, Cumbria). Hopefully they also make a useful self-learning tutorial. A class is the basic Unit of a java program. A public class (i.e. the sort of class we normally use) must be in a file of the same name. For example a class called SayHello must be stored in a file called SayHello.java The following defines a simple class as stated on the first line. This java code should be saved in a file called SayHello.java
public class SayHello {
public static void main(String[] args) {
System.out.println("Hello World!");
}//end of main method
} // end of class SayHello
This work is Copyright Chris Hunter 2007, you may use it for non-commercial purposes |