ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Java J2EE  >>  Java Related  >>  Servlets
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
can v create a constructor 4 servlet?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: can v create a constructor 4 servlet?
Answer
# 1
sure why not if we are not provide a constuctor for servlet 
it automatically get constructor by the java compiler if we 
provide a constuctor for a servlet the java compiler will 
not provide constuctor at that situation
 
Is This Answer Correct ?    3 Yes 0 No
Reddy Akhi
 
  Re: can v create a constructor 4 servlet?
Answer
# 2
yes we can create constructor of servlet instead of init 
method but i dont get servlet specification answers.
 
Is This Answer Correct ?    0 Yes 0 No
Ravindra Nhavi
 
 
 
  Re: can v create a constructor 4 servlet?
Answer
# 3
yes ofcourse we should.
it is mandatory for servlet.
for servlets we required publc no argument constructor. if v
don't having that one, our servlet should not work, even
though if you are not crating the public no-argument
constructor, the java compiler will take the responsibility
to create public no- argument constructor.. mean while your
servlet should be public otherwise you will get
RuntimeException.


we can create costructor for sevelet but it should b no-
argument constructor. and u r servlet should be public. 
and one more thing this constructor in not in the place of
init() method..
 
Is This Answer Correct ?    2 Yes 0 No
Chandra Kunchala
 

 
 
 
Other Servlets Interview Questions
 
  Question Asked @ Answers
 
How to prevent browser from caching the page content?  1
What is context switching?  2
What is HTTP Session ?  1
What type of protocols are used in HttpServlet?  1
hi.... i have problem in running of servlet. i am using Tomcat server in my pc.. The problem is when i am click on strat it will display like below FAIL - Application at context path /first could not be started.. How i can slove the problem.. help plz  1
if u havea .class file ,how can u say whether it is servlet or not ,dont use java decompliler Polaris2
What happens, when client requests for server object, which is not yet loaded into the memory?  1
1.HttpSession 2.Hidden fields 3.URL Rewriting these primitive type of Session maintainance. What is the other type of process that could help to maintain the Session? pls Explain the process if u know? OnMobile3
What methods do we use in Servlet to Applet communication?  1
What is Servlet Context?  2
Explain in detail about applet to servlet communication?  1
What happens, if server sends a cookie to a browser that doesn't supports cookies?  1
What are different types of Servlets?  1
What are setSecure() and getSecure() methods in Cookies?  1
what are the CGI Programs?  2
What is Single Threaded Model in Servlets? Explain this with an example? Wipro6
How can you maintain servlet chaining?  1
what are the way a client can be tracked? IBM1
how do you maintain sessions in servlets? AZTEC2
What is connection pooling? Wipro3
 
For more Servlets Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com