How to Program in Java

This tutorial explains you the steps need to write, compile and test a Java program. This best guide on the topic "How to Program in Java?".

This tutorial tells you how to program in Java? As a beginner you must know how to start programming in Java. Java is programming language which can be used to create many different types of desktop and enterprise applications. Java is also used to create enterprise web applications also.

To program in Java you must have JDK installed on your computer. You should have a text editor to write Java program. Here are the steps of programming Java:

Step 1: Download JDK and install on your computer. See the tutorial Installing Java (JDK 7) on Windows 7 Computer Video Tutorial for more details.

Step 2: Writing Java code into byte code (.java) file. See the tutorial Hello world (First java program) for more details on "How to Program in Java?".

Create simple file and save on your computer. Above tutorial will teach you how to create your first "HelloWorld" application in Java. The next step is to compile the file.

Step 3: To compile the file use the javac command. Command is as given below:


The above command will compile the source code into byte code (HelloWorld.class). If there is any syntax error in the source code the compiler will display the error and stop the compilation process. You will be able to compile your file only if there is no error in source code.

Step 4: Execute the program. This is the final step of testing the Java program. Here it will run on the JVM. To run the java class file java command will be used. Following is the command to execute the program:

C:\javatutorial\example>java HelloWorld

Continue reading.. Read more at Java Tutorial.

Share on Google+Share on Google+

How to Program in Java

Posted on: January 20, 2013 If you enjoyed this post then why not add us on Google+? Add us to your Circles



Discuss: How to Program in Java  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image