Your first java program will do a very simple task, to print something on screen.
public class HelloWorld{
public static void main(String arguments[]){
System.out.println("My first program");
}
}
Explanation:
public class HelloWorld - this line tells that the "class" named HelloWorld is public. This means the class can be accessed by others. I will explain this later on.
public static void main(String arguments) - this line tells that the method main is public and at the same time static. We will learn more about declaring methods later.
System.out.println("My first program") - this line tells the computer to print the message into the screen.
As of now, these are the things that you should know. Make sure that you memorize our example because you need this later on.
We will have more simple examples with the next lessons. I will not dive into the complex topics yet so that newbies in programming can benefit from this.