• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

life cycle methods

 
samanchi snigdha
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The life cycle methods like applet,servlet does not have main method . Though Threads got life cycle method still we write main to get execute. What is the difference between Threads and Applet,Servlet life cycle methods.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only magic about main() is that the JVM looks for the main method on the class you name when you start the JVM. You could put a main() on any class and have it do something interesting. Some people like to include a main() on classes that aren't really the starting point for an application for testing or demonstration purposes.

The life cycle methods are called by the container (server software.) The container spec (servlet or EJB) tells when the container will call them.

I'm not sure how Threads relates to this. Did that help or raise more questions?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic