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

Want a anti iframe breaker, Want a ANTI Iframe Breaker Project Descripti...

Want a ANTI Iframe Breaker Project Description: I want an ANTI Iframe Breaker code made, so that if I'm iframing a site, that contains JavaScript, flash or otherwise, to forc

Write html and javascript code which displays a textbox, Write HTML and Jav...

Write HTML and JavaScript code which displays a textbox and button on a web page? While user enters text in the text box and clicks the button it displays in that text in the m

Writing a program with all the primitive, Problem 1 Explain and Define ...

Problem 1 Explain and Define the following concepts with appropriate examples a) Superclass b) Subclass c) Inheritance d) Exceptions e) Stream classes >>Defining and expl

Describe life cycle of thread, Describe life cycle of thread. Threads f...

Describe life cycle of thread. Threads follow the single flow of control. A thread is execution in a program. The life cycles of threads are listed below: Newborn state: A

Prepare a computer graded test, Please check out the given instruction that...

Please check out the given instruction that I received to do the assessment. I can provide you that link to go on and submit the answers. To assess your coding skills, we would

Problem, #questionSmugglers are becoming very smart day by day. Now they ha...

#questionSmugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they

Preventing applet based social engineering attacks, Preventing Applet Based...

Preventing Applet Based Social Engineering Attacks To help avoid this, Java applet windows are specifically labeled as such along with an ugly bar that says: "Warning: Applet W

Explain the order of evaluation of logic operators, Explain the Order of Ev...

Explain the Order of Evaluation of Logic Operators ? When Java sees a && operator or a ||, the expression on the left side of the operator is evaluated first. For instance, con

Loop, write a program for loop

write a program for loop

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