You have to use main() method in your program.
From here the program execution starts.
like
public static void main(String args[])
{
//This is the starting point of your program.
}
This method must appear within a class, but it can be any class.
In the Java language, when you execute a class with the Java interpreter, the runtime system starts by calling the class's main() method. The main() method then calls all the other methods required to run your application.
The main() method accepts a single parameter: an array of Strings. This parameter is the mechanism through which the runtime system passes command line arguments to your application