How does this happen?
I have the hello world program from the Sun Java tutorial and it is as follows:
/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}
the code from this tutorial is:
package helloworld;
public class MyFirstApp {
public MyFirstApp(){
System.out.println("Hello World!");
}
public static void main(String[]args){
new MyFirstApp();
}
}
Both do the same, why?
|