// This is the Hello Name program in Java
class HelloTwoNames {
public static void main (String args[]) {
String name; //Declare the variable name to be a String
name = "Beth";
/* Say hello to Beth*/
System.out.println("Hello " + name);
/* Say hello to Rusty */
name = "Rusty";
System.out.println("Hello " + name);
}
}
Here's the output:
% javac HelloTwoNames.java
% java HelloTwoNames
Hello Beth
Hello Rusty
%