Create your 1st Java Program


Note
Here I am using,
OS : Linux (Ubuntu 12.04)
IDE : Eclipse Tool
Eclipse : Juno (Version 4.2.0)
Package : Default package

Open File -> New -> Java Project


Output


Output


Output


Output


Output


If you dont have Eclipse, Open your Editor [(Windows -> Notepad) , (Ubuntu -> gedit), or your default editor] and create FirstJavaProgram.java within a folder named as balaji (package name)

Now we can get FirstJavaProgram.java

package balaji.firstjavaprogram;
 
public class FirstJavaProgram {
 
}

Modify below code in FirstJavaProgram.java

package balaji.firstjavaprogram;
 
public class FirstJavaProgram {
 
	public static void main(String args[]) {
		
		System.out.println("Welcome to Java");
	}
}

Now Execute our Application in three different ways.
That are :
          1. Right Click Application Folder (FirstJavaProgram) -> Run As -> 1 Java Application
          2. Run (Menu Bar) -> Run
          3. Press "Run As.." button in Toolbar


Open command prompt (or) terminal. Locate your program path in it.
Compile : javac FirstJavaProgram.java
Run : java FirstJavaProgram

Sample Output

Welcome to Java






SHARE THIS PAGE



product 2

product 3

Feedbacks : balaji.scz@gmail.com