First, use your favourite editor to create a file called Welcome.java, and copy these lines as the content of the file:
public class Welcome { static public void main(String argv[]) { System.out.println("Welcome to the Laboratory"); } }Now, you have your first Java program. Execute the following command in order to compile the program:
javac Welcome.javaIf there are no errors, a file called Welcome.class has been created. This file can be executed in the Java Virtual Machine. Invoke the following command to execute it:
java WelcomeAnd as result of the program execution, you should see the following output in the console:
Welcome to the LaboratoryThat is all.