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                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 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
What will happen inside init() in servlet. my interviewer
asked servlet lifecycle. i said  "once servlet is loaded in
to memory     init() will be called  which performs  servlet
initialization " . Again interview asked what values will be
initialized .  what is difference between init() and
init(ServletConfig config).
 Question Submitted By :: Rajendra007
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What will happen inside init() in servlet. my interviewer asked servlet lifecycle. i said "once servlet is loaded in to memory init() will be called which performs servlet initialization " . Again interview asked what values will be initialized . what is difference between init() and init(ServletConfig config).
Answer
# 1
Your superclass includes two versions of init(),one that 
takes a ServletConfig and a convenience version thats no -
arg. The3 inherited init(ServletConfig) method calls the no-
arg init method, so the only one u need to override is the 
no-arg version.
no law that stops u from overriding the one that takes a 
ServletConfig,but if u do then u better call super.init
(ServletConfig) but theres really NO reason why u need to 
override the init(SC) method, since u can always get ur 
ServletConfig by calling inherited getServletConfig() 
method.
correct me if am wrong
 
Is This Answer Correct ?    0 Yes 1 No
Manidhar
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Explain the term serialization? Wipro6
In what types of operations an ArithmeticException will be thrown?  2
What is a stream? what are the different types and classes of Streams?  2
Which class is extended by all other classes?  2
What is static binding and where it occurs?  2
Why are the methods of the Math class are static?  1
Hi Friends, I am new to java. Can u explain about thread concept.How i know one thread is locked, and how can i force or acquire another thread for lock . Finally how to know thread is released from lock. Explain types of lock(like method level and block level) in thread.  1
What are the steps to do connection pooling in weblogic? TCS1
What is meant by class loader and how many types are there? Apple1
what is synchronization  3
Explain the concept of polymorphism with examples?  4
How many statements can be created with one connection in jdbc? Polaris2
How to avoid the runtime exception ?  2
what is the use of declaring constructor as private? Sai-Softech3
String is a immutable objects . it means that string does not change........... But it will be chang......... { String s="kapil"; String s1="raj"; String s=s1; then print(.......) The String has been changed .. how it is possible and why its called immutable objects  3
What is the difference between error and exception and explain in simple words not whatever is given in the book.  6
Default layout of Dialog object?  1
What are init(), start() methods and whey they are called?  2
How does serialization work Ordain-Solutions2
What is finally in exception handling?  6
 
For more Core Java 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