• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is the main difference between java class and a servlet class??????  RSS feed

 
Rd Dari
Ranch Hand
Posts: 214
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,

I faced a question during my java interview.
What is the main difference between Java class and a Servlet class???


I gave the answer
1. Java is standalone application and a Servlet class is Server side.
2. Java used main method and Servlet used init(),service(doGet(),doPost()) and destroy() method for completion the application.
3. Servlet used for make dynamic HTML pages.and so on..

Bzut the interviewer wanted more answer from me, but I was not able for more..

I want to know what is the exact answer for this question and I have searched in google but I didn't find more else....
So, please clarify it for me in future.....

Thanks!!!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Java class may be used "on the server" as you put it. You can write server components that have nothing to do with Servlets. The key difference to me is a Servlet is deployed into a container and its life cycle is managed by that.
 
Rd Dari
Ranch Hand
Posts: 214
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Sir........
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!