1. Technology
Send to a Friend via Email

Main Class


Hands on a laptop keyboard
Huchen Lu/E+/Getty Images

A main class is a class that contains a main method. This class acts as the entry point for a Java application (i.e., its main method will be where the Java code begins its execution). A main class can have any name although typically it will just be called "Main".


In the below example, the "TimerApplication" class is a main class because it has a main method:

public class TimerApplication {

  public static void main(String[] args) {




# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  1. About.com
  2. Technology
  3. Java
  4. Java Glossary
  5. M
  6. Definition for the Java Term: Main Class

©2014 About.com. All rights reserved.