In this section you will learn how to develop your first Java program and then compile and test the same on your development machine.
First Java Program
In this section you will learn how to develop your first Java program and then compile and test the same on your development machine.
Write first Program in Java
In Java, all source code is written in plain text files
with the .java
extension. These source files are then
compiled into .class
files by the javac
compiler. This .class
file does not contain code that is native to
your processor; instead it contains bytecodes that is the machine language for
the Java Virtual Machine.
You can write a Hello World program as your first Java program. Hello world program is the first step of java programming language. To write the Hello world program you need simple text editor like note pad and make sure the JDK must be install on your machine for compiling and running that program.
Learn to write Hello World Java program at http://www.roseindia.net/java/master-java/helloworld.shtml
Compile and Test the Program
Java provides javac compiler to compile the Java program. To compile your HelloWorld program, open the command prompt. Go to the directory where you have saved the file and issue the following command to compile the program:
C:\javac HelloWorld.java
Learn how to compile and run Java File at http://www.roseindia.net/java/master-java/helloworld.shtml