Hello World Application

April 13th, 2009 | Tags:

Tutorial Description:

Learn the basics of Java scripting with this easy to understand tutorial.

Everyone knows of the HelloWorld Application no?

Well in Java, it is as simple as this.

public class HelloWorld undefined

Ok in the class part:

public class HelloWorld

We are stating that we are to create a new class called HelloWorld. The public part means that this class is available to any other class. You will get familiar with public, final, and different kinds of modifiers as you get more into methods.

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

This means that we are sending a message to the screen. The System.out.println defines this. It will send whatever is in quotes to the screen. SO in this case, you will see
Hello World!
Every ending statement also ends with a semicolon ‘;’

When you save this program, you should save it exactly as the class name. In this case, we named our class HelloWorld. SO when you save this file, you MUST save it as HelloWorld.java . Now when you compile this program it creates a .class file of our class. So in this case it would create – HelloWorld.class. A dot class file is pretty much the computer’s way of understanding what we type!

No comments yet.
TOP