Every application must have a starting point, and for BlackBerry applications it is at a method named main
. The use of the name main
goes all the way back to the C programming language, if not further. At that time, simply making a method named main
was enough to be able to run an application. However, because Java is an object-oriented language, you can't just make a method named main
. In Java, all methods must be in a class, and this includes the method main
as well.
In addition to the main
method all BlackBerry applications must contain an object derived from Application
as well. As both the Application-derived
class and the main
method are required, it is standard practice to include the main
method in the same class as your Application
.