Java - Hello World!

56

1

The first step in learning any programming language is to have it print out "Hello World!" This instructable will take you through all the necessary steps to print out hello world in java.

Step 1: Download Java

Download Java from Java's official website.

Step 2: Choosing an IDE

To program Java all you really need is a simple text editor such as notepad, but nobody wants to torture themselves like that. There are various Integrated development environments (IDE) that can be used to program java that offer many features such as automatic compiling and error recognition. Pictured above is Intellij by jet brains. It is considered to be the best Java IDE, but it is expensive. For this instructable I will be using Eclipse which is a free alternative.

Step 3: Create New Project

Click on the create new project button and select new java project. You can input the version of java that you want. I am using java version 1.8. Name the project whatever you want. I named mine Hello World. When you're satisfied with the options create the new project.

Step 4: Create New Class

All code in java is written in a class. Create on by clicking on the create class button in the top row. Be sure to check the public static void main option. If you don't its not a big deal. just copy the function below inside the class curly brackets.

public static void main(String[] args) {
// TODO Auto-generated method stub

}

Step 5: Type Code

Inside the public static void main function type

System.out.println("Hello World!");

You can put anything you want in the quotation marks. To run the code click on the play button in the top row next to the other options.

Share

    Recommendations

    • Arduino Contest 2019

      Arduino Contest 2019
    • Trash to Treasure

      Trash to Treasure
    • Tape Contest

      Tape Contest

    Discussions