C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

can we write a parameterized constructor in servlet class or not?

0 votes
25 views
asked Feb 6, 2014 by john Guru (27,140 points)

1 Answer

0 votes
A web container creates a servlet class  object by calling the newInstance() method .
NewInstance() method checks for the fallowing 
a)A class is public or not
b)A class contain default constructor not.
If we write only parameterized constructer in a servlet then it does’t contain a default constructor then the program will not be executed.
If we write a parameterized constructor and default constructor then servlet is valid  and it’s object is created by the web container by calling the newInstance() 
 
answered Feb 6, 2014 by sara Guru (24,570 points)

Related questions

0 votes
1 answer 34 views
34 views asked Jan 2, 2014 by smith Geek (15,340 points)
0 votes
1 answer 4 views
0 votes
1 answer 14 views
14 views asked Jan 4, 2014 by keem Expert (13,240 points)
0 votes
1 answer 1,067 views
0 votes
1 answer 28 views
...