This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes life cycle methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "life cycle methods" Watch "life cycle methods" New topic
Author

life cycle methods

samanchi snigdha
Greenhorn

Joined: Mar 22, 2007
Posts: 12
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

Joined: Jan 29, 2003
Posts: 8791
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?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: life cycle methods
 
Similar Threads
Servers
what happens when the first request comes to the webserver?
What is the life cycle of Bean instances?
why lifecycle method required ?
init and constructor in servlet