Saturday, October 6, 2018

How to Start First Java Program

1. Start Eclipse

2. Create a new Java Project

a)    File à New à Project


Java-project



a)    Select ‘Java Project’ and Click on ‘Next’.

      
Java-Program



c) Enter the project name into the project name field.


Create-Project




           d) Click on ‘Finish’.




3. Creating a new Java Package under the Project:


           a) Right click on Project nameà New à package

          
Create-Package



           b) Enter package name and Click on ‘Finish’.


       
Create-Package






4. Creating a new Java Class under the above package:


          a) Right click on package name à New à Class


          b) Enter Class name à Click on ‘Finish’




This is my first created class. In this, we create a main method and write one line of code.






package firstJavaPkg;

public class HelloProgram {
           
         public static void main(String[] args) {
                                   
             System.out.println("Hello Program");
             
                        }          

}



Output: Hello Program






No comments:

Post a Comment