Use the constructor, instead of init, JAVA Programming

Assignment Help:

Can we use the constructor, instead of init(), to initialize servlet?

Ans) Yes. Of course you can use the constructor instead of init(). There's nothing to stop you. But you shouldn't. The main reason for init() was that ancient versions of Java couldn't dynamically invoke constructors with arguments, so there was no way to give the constructor a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won't have access to a ServletConfig or ServletContext.

 


Related Discussions:- Use the constructor, instead of init

Describe about user security issues and social engineering, Describe about ...

Describe about User Security Issues and Social Engineering ? Contrary to popular belief most computer break-ins through external hackers don't happen since of great knowledge

What are the two primary methods of implementing security, Question : a...

Question : a) There are up to 14 different built-in groups that might be located by default in the Builtin container including "Account Operators", "Incoming Forest Trust Bui

Online Store Website, Project Requirements • Create your own online store ...

Project Requirements • Create your own online store Web site, selling products of your choice. • Create pages that allow you to search and buy available products, as well as add,

Write a program to explain do while loop in java, Write a program to explai...

Write a program to explain do while loop in Java ? // This is the Hello program in Java class Hello { public static void main (String args[]) { int i = -1; do { if (

I want an ehospital project, I am preparing ehopsital project. For the need...

I am preparing ehopsital project. For the needs of hospital in that billing module and patient registration and stores module and e.t.c module is there for hospital needs. Skill

Jdbc, creating connection which will authenciate for a password

creating connection which will authenciate for a password

Write down the class electricitysource, Question : (a) Explain the con...

Question : (a) Explain the concept of polymorphism when used in programs using suitable examples of your own. (b) (i) Distinguish between abstract methods and non-abstrac

Write a program to add of doubles in java, Write a program to add of double...

Write a program to add of doubles in java? Doubles are treated much the similar way, but now you obtain to use decimal points in the numbers. This is a same program which does

Develop an android prize wheel, Project Description: I am seeking someon...

Project Description: I am seeking someone to prepare a small Android app for a promotional offer. It must be designed for use on an Android tablet. Fundamentally, a user will

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd