Hello World

OliverE

Power member.
Reputation
0
eclipse.png


Hello World



  • java3q.jpg
  • java6.jpg
  • In the code view add the code below
  • [attachment=115]
  • [attachment=114]

Code
[java]
public class HelloWorld
{
public static void main ( String args [ ] )
{
System.out.println("Hello World");
}
}
[/java]
Explaination
This snippet of code makes use of the print line function which basically just prints a line onto the console with the specifed output.

Thats it!, more tutorials to come.
 
Keep in mind, according to Carolus and some other sites, you should do String[] args instead of String args[]
 
It doesnt really matter where you put it, is doesnt change anything.
Had a discussions about this with our Java tutor.
 
It does. Because with String[] args, you can declare an array of strings.
 
I know, very bad practice, but im just copying what my tutor puts :p
Like I said we had a dicussion about it, basically about what were talking about.
 
Bad habits Bleepers!!!! If you ever get into LWJGL game dev you'll get errors!
 
Yer I but like I said, not my problem, until it becomes my problem.
Looking back at my notes, its all the same.

Gonna chat to my tutor again to see why they keep wiriting it the wrong way round.
 
Or if you try to declare an array of strings!

Most likely because they are not preparing for LWJGL.
 
Haha thats great, how did you find it?
Maybe you could follow my tutorials?
 
It was quite easy, im really surprised.
My friends at school say they know Java, now I do too.

I think I will do, its really interesting.
 
i think you are going to be makeing great programes in Java you have realy stuck to it and if you want to have some fun useing Java try this game http://robocode.sourceforge.net/ you basicly code the AI of a robot and let it kill other robots
 
Back
Top