How to install eclipse and execute your first program in java

0
2127

In this tutorial we will learn how to install eclipse and execute your first program in java, have a brief lookout on operators used in java programming and have a short description regarding it.

  • To learn how to install eclipse and execute your first program in java and to have a brief overview on operators follow the steps given below :

  1. Steps for installation of eclipse :
    1. First of all open up the browser.
    2. Open up google search engine and enter the keyword as download eclipse in it.

    3. Just select the eclipse kepler indicated by the arrow as shown in the above image.
    4. You will get the below screen where you have to select the eclipse IDE for your respective machine i.e 32/64 Bit.

    5. You will be navigated to the following screen :

    6. Just click on the download button as shown in the image and that’s it.
    7. After it gets downloaded you will get a compressed file of eclipse as shown in the image below:

    8. Now just right click on the zip folder and extract it. After extracting it just double click on the eclipse folder and you will get the following window :

    9. Now double click on the eclipse icon and it will ask you to save your workspace.

    10. Click on browse button, set your workspace and then click ok. You will get the eclipse window as shown bwlow :

    11. Here Installation of eclipse is completed.
  2. Steps for writing your first program in java
    1. click on File-> New-> Java Project as shown in the image.

    2. Now a dialog box will appear where you will be asked to specify your project name . After specifying your project name click on the Next button.

    3. After clcking on the next button you will get another dialog box as shown below where you have to click on the Finish button.

    4. You can see your First Project created at the right hand side corner in the package explorer.
    5. Now double click on that project it will get expanded and you will see the src folder.
    6. Right click on src -> New -> Class as shown in the image.

    7. A dialog box will appear where you have to enter the class name then choose the public method then click on Finish button.

    8. Your class will be created successfully and you will have the following window :

    9. Now in main method write the print statement i.e. “ System.out.println(“ ”) ”.
    10. And in the print statement in ” “ enter your message i.e. System.out.println(“This is my first program in eclipse”)
    11. So, you will have the following view of your window :

    12. Now click on save button which is indicated by an arrow in the above image.
    13. Now lets run the program.
    14. At the left hand side double click on your Project name -> src -> (default package).
    15. Now right click on our class name -> Run As -> Java Application.

    16. Now the output will get displayed on the console.

    17. Thus we have learned how to write and run a java program in eclipse.
  3. Operators and Conditions: –
    • We can divide operators in six groups: –

    1. Arithmetic Operators: –

    2. Bitwise Operators: –
      This operators works on bits and perform bitwise operations, it will give you result in binary format.
    3. Example :



    4. Relational Operator: –

    5. Logical Operators: –
      If a holds value true and b hold value false.

    6. Assignment Operator: –


    7. Example : This example shows how to use java operators in a class.


      Output :


  4. Hence, we successfully learnt how to install eclipse and execute your first program in java .

LEAVE A REPLY

Please enter your comment!
Please enter your name here