Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Hello world (First java program)

                         

Java is a high level programming language and it is used to develop the robust application. Java application program is platform independent and can be run on any operating System. Writing Hello World program is very simple. To write the Hello world program you need  simple text editor like note pad and  jdk must be install in your machine for compiling and running. Hello world program is the first step of java programming  language. Be careful when you write the java code in your text pad because java is a case sensitive programming language.

 For Example

hello world   !=(not equal to) Hello World

Write the following code into your note pad to run the Hello World program .

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

Save the file and Please remember the location where you save your file. In this example we have saved the file in the "C:\javatutorial\example" directory. The file name should be match the class name and to save the file give the .java extension. e.g.  HelloWorld.java

Now open the command prompt to compile the HelloWorld.java program. Go to the directory where you have saved the file ( in our case C:\javatutorial\example>) and issue the following command to compile the program:

C:\javatutorial\example>javac HelloWorld.java

javac is a compiler in the java Language. Java compiler change the programming Language into machinery language. So that the java virtual can understand it. Once the compilation is successful a new file will be created with the name HelloWorld.class.  To run the program issue the following command on command prompt:

C:\javatutorial\example>java HelloWorld

You will see the following result on the command prompt.

Hello World!

Here is the screen shot of the above steps:

In this lesson you have learned how to write and then test the Hello World! java program.

 

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

12 comments so far (
post your own) View All Comments Latest 10 Comments:

hi, i am learning java.
C & C++ has a software (compiler) which vwe can execute. but in case of java id this the only option to execute ie to run in commend prompt. dont v have software where v can write the programm n execute.

Posted by naveen on Monday, 10.13.08 @ 23:34pm | #81058

i dont understand how to run the program in vista's command promt

Posted by a beginner on Saturday, 10.11.08 @ 03:08am | #81005

hi, i too new to java- i just run the hello world program, no output it comes back to command prompt! ---- any idea why? plz help

Posted by shashi on Tuesday, 08.5.08 @ 19:22pm | #71143

Iam a biginner to java i think this is helping me a lot to understand the basic concepts of jave, could you please let me know what i should do as a bignner.

Posted by jaipal on Saturday, 01.19.08 @ 05:52am | #45553

i m a beginner to java and want to learn more thru tutorials.do send me.at the given mail i.d.daily.

Posted by minakshi on Wednesday, 01.16.08 @ 13:09pm | #45335

Iam a biginner to java i think this is helping me a lot to understand the basic concepts of jave, could you please let me know what i should do as a bignner.

Posted by kiran on Sunday, 09.30.07 @ 19:33pm | #30508

Really nice tutorial

Posted by Sojan Chandy Therakom on Friday, 03.30.07 @ 12:52pm | #12978

this program is good

Posted by krishnakartheek on Tuesday, 03.6.07 @ 10:13am | #10806

I am beginner to java, please gives me more help to run my program dan more information for this program

Posted by honey on Monday, 02.26.07 @ 06:38am | #9609

i am an undergraduate in computer science and have learnt c++ but i fancy java and want to know more about it.

Posted by patrice on Thursday, 02.8.07 @ 18:25pm | #6814

Latest Searches:
Treemap using gwt tree
shapes in applet
Photoshop Basics Draw
Java code for media pl
paramters
list in java
http get example
é???é????é????é???é???
form capture
input in array
Dreamweaver Behaviors
jdk-1.4.2
String to array in jav
breaké??å?¤?é?????é??å
changehashtablevalue
line break in javascri
two dimensional array
utility of collections
map iteration in jstl
JavaScript functions o
redirect
hashmap
break?ะ�ะ???????
how to increase the er
c tutorial
how to edit a any file
calling one jsp p
code for select date a
Generics
read a file
ะà¸??ะà¸
extract
close a frame
Move cursor to upper l
how to increase the er
numberStringsource
jsf comments
major
Copy One Database Tabl
example for adding the
html:frame
database path
decimal to binary conv
constuctor
Date in JSP
how to track user logi
character in javascrip
ล ยà¸?ฤ??????à¸
how to long progrm ja
Photoshop Drawing Awes
get data by using char
Declare tag methods in
javascript DB servl
iterate nest
program for display th
combo box field call a
tabbed pane
netbeans jsp
get array in java usin
ASP EXAMPLE' and char(
Configure jstl in web.
sะà¸?ั?ยà¸?ะà¸
Creating Website with
save image to file
java code to connect t
Checking
File Validation code
how is application of
enterprise portal
disable minimize butto
hast table
advantages of jsp over
Custom Tutorials
removing spaces betwee
struts2 tag
add check box to a jta
Tiles definition richf
column name in panel g
jar entry
PHP Web Traffic Analys
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.