Home Java Beginners Java How to Program
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Java How to Program

Advertisement
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.

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.

Advertisement

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 14, 2013

Ask Questions?    Discuss: Java How to Program  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com