Home » NO IDEA » Java hello world -Program_1

Java hello world -Program_1

Blog Stats

  • 14,863 hits
December 2013
M T W T F S S
« Oct   Jan »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

This is a simple java program where you must hello java in the console screen.

In netbeans the output is seen at the bottom of the IDE itself after pressing SHIFT +F6

The code for the hello world is :

public class Hello {

public static void main(String[] args )
{
System.out.println(“Hello Java “);
}
}

Output:

java_one

Program Explanation :

1.we create a class called “Hello” .In java program must contain atleast one class

2.Usage of pubic static void main (String [] args ) will be explained in another tutorial just for now follow the syntax blindly

3. System.out.println(“harinath”)  .This tells java compiler to print the arguments within the codes in console screen

Other Related command with Printing 

System.out.println()  –> helps to print the string in the screen and place the cursor to the next line

system.out.print()     –> helps to print in the same line

system.out.printf()   –> similar to c program

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

%d bloggers like this: