public class HelloWorld {
private final String output;
public HelloWorld(String name) {
output = "Hello World, " + name;
}
public String getMessage() {
return output;
}
public static void main (String args[]) {
HelloWorld helloObj; // illegal start of expression
helloObj = new HelloWorld();
System.out.println(helloObj.getMessage());
}
}