HomePortalFAQSearchMemberlistUsergroupsRegisterLog in


 Hello, World! Java Tutorial

Go down 
The Fellow
The Fellow

Posts : 100
Join date : 2010-04-28
Age : 26
Location : In my head, dreaming up how to shake up the world

Hello, World! Java Tutorial Empty
PostSubject: Hello, World! Java Tutorial   Hello, World! Java Tutorial I_icon_minitimeMon Oct 25, 2010 2:59 pm

Hello, Java World!

The way to make a hello world program in java is fairly simple. Let me walk you through it.

First, we state the name of the class:

class HelloThar{
This tells the compiler that the class HelloThar starts there. If you are unsure what this whole class thing is, just think of it like a blue print of a object, with all information about it.

Then we give the code a main, just like in many languages:

public static void main(String[] args) {
There is a lot of gibberish in there, of which I will explain in a different tutorial. Just know that that lines starts the method main of the HelloThar class. If you do not know, a main is just what you probably can think of what it is; Everything being put into one place in a program.

Now we tell it to print, using the System.out class method println:

System.out.println("Hello, World!");
Always end a method call with a semi colon. If you are wondering about all those dots, it is because we are calling the System.out class so that we can use it to print. There is ways you can get around typing that whole line, but we will get into that later.

Finally end all your wrappings: first your main, then your class.

Now you have your first ever Java program, a simple hello world!
Back to top Go down
View user profile http://compilecrazy.forumotion.net
Hello, World! Java Tutorial
Back to top 
Page 1 of 1
 Similar topics
» 2010 World Youth Chess Championship – Final report
» Adolf Hitler - World Chess Champion.
» Jester java chess program
» Which chess player beat the most World Champions?
» Curl Tutorial!

Permissions in this forum:You cannot reply to topics in this forum
Compile Crazy :: Programming :: Java :: For Beginners-
Jump to: