Hello World in java

Hello World!

It all start from here. So lets start the journey by writing a program to print hello world.

Open your favorite IDE.

  1. Go to File -> New Project

hello world in java

2.  Select Maven in categories -> Java Application in Projects.

You can read this blog to know about maven.

 

hello world in java

 

3.  Give you project name. I have given helloworld you can give your own.

Hello world in java

4. Your project structure looks like following:

Hello world in java

5. Write click on the package [com.liveoncode.helloworld]   New – > Java class and give the name HelloWorld.

Hello world in java

6. Now copy following code and paste it.

public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello World!");
}
}

7. Now run the program. You will see Hello World! as output.

Now lets move forward.