Here are the first step in creating your java file:
1. The class name must be the same name as the java file. (if the file is test.java, the class needs to be called test).
So, lets begin by creating the classical "Hello, World!" first program that we all know and love.
The understood java rules say that class names should begin with a uppercase letter. Know that having it in lowercase is perfectly fine, but that isn't the standard.
Code:
public class Hello{
public static void main(Strings[] args)
{
}
}
I am not going to go into full detail on what the public and class means. Just make sure you have public class NAMEOFCLASS and then public static void main(Strings[] args) to start out your java code.
Now to simple print out a message, you use System.out.println();
Code:
public class Hello{
public static void main(Strings[] args)
{
System.out.println("Hello, World!");
}
}
Thats it! See how simple java can be? Hello, World! needs to have double quotes around it because it is a string.
-More to come later
