[QUICK TUT] Java

Status
Not open for further replies.

olea

New Member
Dec 12, 2010
20
5
Many people think that java is an advanced language. Java is advanced but it EASY to learn when you can the basics.

I will just show how to make a SIMPLE application in a minute.

Working for all platform/ OS!

You require:

  • JDK (Java devoplment kit) avaible on sun.org!
  • And kind of test program.
Open up your text editor.
Start your class by this code:
Code:
class Devbest {

}
Now you have the start of the java code.

Next step:

Code:
public static void main (String[] arguments) {

}
This code says to java that the command, comes inside this area will be showed.

Next step:

Code:
System.out.println( "Devbest its working!" );
This code is printing a line with text: Devbest its working!

Full code:
Code:
class Devbest {
      public static void main (String[] arguments) {
             System.out.println( "Devbest its working!" );
      }
}

Save the file as: Devbest.java (Since the class is name devbest the filename MUST be devbest.java or it will not work)
Open up CMD and type in:
C: (Click Enter)
cd (Location where you saved the devbest.java) (Click Enter)
dir (Click Enter)
javac devbest.java (Click enter)
java devbest (Click enter)

Then it will popup the message you writed in java line.

OR you can make a path file (only for windows)

Open a new text document
Type in:
javac devbest.java
java devbest

Save the file as: run.bat
and open the file up

put it in same location as the devbest.java file.

If it dident work for you, then download the project here:
 
Status
Not open for further replies.

Users who are viewing this thread

Top