Here is a simple script that when run displays "Hello World!" into the commands prompt. More will be explained about it after.
Code:
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
"public static Hello" is defining the class to be:
public (Can be accessed by other classes)
static (can be access inside this file)
and to be named "Hello" (NOTE!: your file must be named the same as the class that contains the main method header, which in this case would be the Hello class)
"public static void main(String[] args)" is the main method header, any file that will be ran will need this method.
public (can be accessed by other classes or methods)
static (can be accessed by the rest of this class or other methods in this class)
void (the method's return type)
I must go for now but soon I will post a guide on compiling and running a java class file in a windows OS. :wave: