Table of Contents
List of Figures
Table of Contents
J2SDK can be obtained from http://java.sun.com.
Any Java program that is to be run from the command line must contain main method.
This method has signature public static void main(String[] args).
Table of Contents
More complex program will be shown...
Figure 3.1. Hello World 2, our second Java program
public class Hello2 { public static void main(String[] args) { System.out.println("Hello, "+args[0]); } }
Also very short program in Java.
It contains only one class with only one static method - main.
Prints “Hello, name!” where the name is specified as the first parameter when launching the program.