When you call a class from the command line, the entry point into your class is the main method.
When you call a Servlet or JSP, the entry point is the service() method, but by default it then calls the doGet or doPost methods for us, so we use these entry points instead.
Applets have a different entry point, they don't have a main() method either.