Saturday, January 11, 2014

Simple Java program

class HelloWorld {
          public static void main(String args[]) {
                   System.out.pritln(“Welcome to Hello World”);
}
}

After typing this program, save it as HelloWorld.java and compile the program with javac command, that is
Syntax for compile is below:
javac filename.java
So here, javac Helloworld.java
Now run with the following Run command
Synatx:
java filename
So here, java HelloWorld
Finally the output is
Welcome to Hello World 


Let see through the flow

No comments:

Post a Comment