Class – By using classes we can create different objects.
Public – Which means it is visible to all. Represents the visibility.
Static – If a method is static we do not need to create object to invoke the static method.
Void – This is the return type of the method which means it does not return any value.
Main – Indicates the startup of the program.
Following is a very basic type of a Java program.
Open your Notepad and write a simple java program as above. Save the file as Fish.java. To compile and run the program, go to your command prompt and give the command to run the program.