Simple program in java.

Write a program to print hello world.

public class HelloWorldExample{

public static void main(String args[]){

System.out.println(“Hello World !”);

}

}

OUTPUT

Hello World !

How to run java program

Save your file same as class name.java

Run command promt

javac file name.java

java file name

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s