Program Structure
//the skeleton of a java application
package packagename;
import packagename.ClassName;
public class ProgramName
{
// Define program variables here.
// Define program methods here.
//Define the main method here.
public static main(String args[])
{
// Main method body
} //end of the main method.
} //End of class HelloWorld
Notes
package packagename;
import packagename.ClassName;
public class ProgramName
{
// Define program variables here.
// Define program methods here.
//Define the main method here.
public static main(String args[])
{
// Main method body
} //end of the main method.
} //End of class HelloWorld
Notes
- Packages and imports statements are optional
- Main class and main method Mandatory
- Java is a case sensitive language
- Braces must occur on matching pairs
- Coding styles should be followed.