Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the difference between?when we write the code in
following manner?

class One extends httpservlet
{
}
and
class One extends genericservlet
{
}

Answer Posted / saikiran

We are extending GenericServlet because of 3 Reasons
1.no need to implement 5 metods JVM will take the
responsibility to implement 4 methods init(),deistroy
(),getServletConfig(),getServletInfo()
2.Object to Object communication
2 point is there in java1.0 that is not there because of
when the Object is taking Anther Object Reference that
was unnessarly misusing
finnaly we don't have much benifits and we are
UnNecessarly Incresing the Load on JVM
We are extending HttpServlet Because of
People are Mainly Using Http in Most of the Time for
that sun has given API to Convinient to those People
Note:GenericServlet and HttpServlet are Doesn't knows to
ServletContainer
Because of that was Violationing the
1.Public with NonAbstract

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a servlet context object?

1092


Can we use threads in Servlets?

1078


How can the referrer and the target urls be used in servlet?

947


what is multiple server?

2254


Can we fetch the attributes related to a servlet on a different servlet?

1082


Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?

1204


Is servlet a server side scripting language?

1064


What do you understand by mime type?

944


Why do we have servlet listeners?

1023


What is servlet lazy loading?

1111


What are the common methods that are included in the http servlet class?

993


What do you mean by scope object and what are its types?

1022


Can we get PrintWriter and ServletOutputStream both in a servlet?

1101


What do you mean by deployment descriptor?

960


What is the purpose of requestdispatcher interface?

1001