Java How to Program

How to program in Java for beginners tutorial illustrate the basic requirement for developing an application in Java and also talks about how to code your first application in Java.

Java How to Program

How to program in Java for beginners tutorial illustrate the basic requirement for developing an application in Java and also talks about how to code your first application in Java.

Java How to Program

The article "Java How to Program" elaborates what is needed to run Java program on your computer and also how to write and run your first java application. It is good to start writing your first application with the tradition Java Hello World app. But first take a look at the various requirements for having a Java development environment on your computer.

To write and run your first Java application following setup is required.

  • Java Compiler
  • Java Virtual Machine (JVM)

A compiler is required to compile the Java source code to bytecode. Wereas Java Virtual Machine (JVM) is required to translate Java bytecode into machine language on the target processor. Java How to Program tutorial recommends you to download a correct package for your platform and IDE. Eclipse or NetBeans to write your application in Java.

Now follow the given steps of Java How to Program:

  • Download and setup a Java Development environment on your computer
  • Download and install either IDE, Eclipse or NetBeans development platform to develop applications in Java.
  • Write, compile and test your first Hello World Application.
  • Compile the class file
  • Finally Run the program with the Java executable.

Here is the first Java Hello World code to understand How to Program in Java.

class HelloWorld
{

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

    //Displays the output String on the Command Prompt

    }
  }

/** 
Displays "Good Morning India!" to the standard output.
**/ (Comment)**strong text**

Save your Java application file as "HelloWorld.java" and to compile and run your Java Application follow the given commands.

 To Compile Java Program

  • C:\Program Files\Java\jdk1.6.0_01\bin>javac HelloWorld.java

To execute Java Program

  • C:\Program Files\Java\jdk1.6.0_01\bin>java HelloWorld

Note: We have installed JDK for Development purpose.

Java completely based on the OOPs concept and is a platform independent. To learn more on Java visit Roseindia Java Beginners Tutorials for Basic Java Code and Examples.