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

Compiling and Running the program

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 
Latest Searches:
Java Count Vowels
CENTER_ALIGNMENT
MULTIPLESELECTCOMBOBOX
breakâ?¨Ð°â?¬â??â?¨Ð°?
upload file to server
HTTP post data in wick
abstract class program
Flash Special Effects
Image with mouse drag
Insert Data into Datab
ant tutorial
Xmlparsingusingservlet
hibernate2 Tomcat5.5 s
how to write the zoomi
create excel using jav
public
login jsp
sample examples in spr
table j2me
insert content to text
ajax login on onsubmit
typecast between strin
json lib//componen...]
json lib//componen...]
logical and rational o
basic flow of struts
To Determine whether t
Java Count words,reve
matrix subtraction
activemq
applet viewer login pa
sevlet
Display Data from Data
marge sort
trim
web.xml file
Java Mysql
jQuery To Hide the Div
â?¨Ð±??â?¨Ð±??â?¨Ð±??â
error with name in jsp
text box character val
Photoshop Text Effects
java random numbers
hibernate many to many
Photoshop Textures and
3d max tutorial
jsp prompt box
reset in struts
upload files
Java / multi thread
progressbar in JSF
program for display th
Linux Caixa MÑ?â??â???
JViz
put string into a list
insertdatatotextfileus
viewing content in a f
program to validate us
Combattons la programm
ะ�??????ะ�????
emailing file in java
Fireworks Basics Custo
Audio
java write file line b
break?தà¯???தà¯??à
clear a text file befo
jsp and javabeans
sample code
Combattons la programm
RefactorIt
Useof<fn:substringBefo
Read the Key-Value of
JiXB
j2se
Linux Caixa MХ ТÐ??
hashset
jsp drop down menu
JUnit and Test-Driven
?���??���?
jQuery to Image Scroll
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.