• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 214
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Sir........
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic