a java tutorial

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply

was this a good tut?

yes
0
No votes
no
0
No votes
 
Total votes: 0

stephen10101





Posts: 140
Joined: Sat Jul 29, 2006 9:11 pm
Location: Klein, TX

a java tutorial

Post by stephen10101 »

http://www.jcreator.com/download.htm - dl the second one, it is the free version of J creator

ok, i have done a search of this forum and there are no java tutorials, so i decided to make one. :D i MIGHT add on to this if i have the time, which i most likely will, and also if you say i should. so anyway, here is the tut.

first of all, you will need a compiler. i would recomend J creator, which you can google to find a download, because i forgot where i found it . :P
once you have that you open it. (what a shocker!) then go to file-new-java file and name it "Hello" i will say why later, and put it where you can find it, because starting over sucks. so now that you have it open and ready, enter this here code:

Code: Select all

Public class Hello
{
   public static void main (String[] args)
   {
      System.out.println("Hello World");
   }
}
COMPILE AND THEN EXECUTE!!!! "Hello World" should come up in a command prompt looking window.

now for the learning part. YAY!

Code: Select all

 Public class Hello 
looks for a file named "Hello.java" and that is why you named it that. the first bracket/curly brace/brace (whatever you call it) is for the starting point. that is what the

Code: Select all

 [public static void main (String[] args) 
does. in the second set, is the program statements. the

Code: Select all

System.out.println("Hello World");
puts "Hello World" on the command prompt looking thing, and well the closing brackets close the brackets. :roll: so now you know how to make a program in java! i bet you are happy. like i said, i might continue writing these.
Last edited by stephen10101 on Sun Nov 12, 2006 10:02 am, edited 2 times in total.
User avatar
dos mes





Posts: 2158
Joined: Thu Dec 29, 2005 9:58 pm
Location: Syracuse, NY

Post by dos mes »

I believe you can get a free compiler from Sun themselves if I'm not mistaken. I'd stick with that one.
infectious





Posts: 1
Joined: Sun Nov 26, 2006 12:24 pm

Post by infectious »

yeh you can.
wooo go solarus and java.
Post Reply