View Single Post
  #7 (permalink)  
Old 07-17-2007, 03:34 PM
PCsmasher PCsmasher is offline
Newbie
 
Join Date: Jul 2007
Posts: 3
Credits: 0
Rep Power: 0
PCsmasher is on a distinguished road
Default 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?
Reply With Quote