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

Inner, #question.Hi, i hope my message find you very well. could you help m...

#question.Hi, i hope my message find you very well. could you help me please with this question . provide an example code for an anonymous inner class. Highlight what makes your e

Recursive Division Maze Generation, can you tell me what the code for a 2d ...

can you tell me what the code for a 2d random java array using Recursive Division Maze Generation

Board coloring, write a java program to board coloring

write a java program to board coloring

Card, Create a class called DeckOfCards that stores 52 objects of the Card ...

Create a class called DeckOfCards that stores 52 objects of the Card class. Include methods to shuffle the deck, deal a deck, and report the number of cards left in the deck. The s

Java is object oriented programme language, Java is Object oriented program...

Java is Object oriented programme language Java is comprehensively OOP language with robust memory system Memory errors largely disappear due to safe pointers and garbage c

Difference among using bind() and rebind() methods of naming, What is the d...

What is the difference among using bind() and rebind() methods of Naming Class? Ans) Bind method (String name) binds the specified name to a remote object whereas rebind(String

Student Grades Program, The program: 2 classes one called Student, one ca...

The program: 2 classes one called Student, one called Grades Functional Requirements: Ask for how many students u need to enter the program must: prompt the user to enter the

What is file transfer protocol, What is File Transfer Protocol? This pr...

What is File Transfer Protocol? This protocol is used to upload the files on remote computers. This is used to transfer files among computer on TCP/IP network e.g. internet and

Simple Program in Java, Write a programme to create a webpage that prints t...

Write a programme to create a webpage that prints the name of the STUDENT database in Wide Latin font and set the subtitle with description of the STUDENT to the screen. Set the pa

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