Friday, January 2, 2009

Hello World Program in Java

Hello all, Welcome back to Java Code Online. Today I will start with a very simple Java Code program. This is called the Hello World Program, and when executed prints "Hello World" at the output.

public class MyFirstCode{
public static void main(String args[]){
System.out.println("Hello World");
}
}

This program needs to be saved with the name of MyFirstCode.java, because in Java the name of the class containing the main method, needs to be the name of the java file itself.

When you execute this code, then you will get the output as "Hello World".

So, enjoy the world of Java, and make your own experiments with coding. See you later guys and gals. Keep buzzing Java Code Online.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.