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 is static and a non-static inner class?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is static and a non-static inner class?
Answer
# 1
Non Static inner classes have object instances that are 
associated with the classes outer class.Static inner 
classes have no object instances.
 
Is This Answer Correct ?    0 Yes 0 No
Guest
 
  Re: What is static and a non-static inner class?
Answer
# 2
Static inner class 
can only access the static members of the enclosing class.
not associated with the instance of the enclosing class.
can only have static members.

Nonstatic class
is associated with the instance of the enclosing class.(we 
need it first to access the nonstatic class)
can access all the member of the encosing class.
is like other members of the enclosing class.
 
Is This Answer Correct ?    1 Yes 0 No
Karthee
 
 
 
  Re: What is static and a non-static inner class?
Answer
# 3
non static inner classes can access all the members of the 
outer class i.e both static and nonstatic members.In 
nonstatic inner classes we cannot have static declarations 
done.To access  non static inner class members we outer 
class reference.

static inner classes can access only static members of the 
outer class.In static inner class we can have static 
declarations done. To access  static inner class members
no need of outer class reference.
 
Is This Answer Correct ?    0 Yes 0 No
P.nandakishore
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Can a double value be cast to a byte?  3
Why are the methods of the Math class are static?  1
How to create two different thread class inside a main function?  1
What is HashTable?  3
what is real-time example of runtime polymorphism and compile time polymorphism  1
what are depricated methods ? Satyam4
Can u overload main()method.Give with example. IBM2
how to compile jsp? Logica-CMG3
There are 2 classes, 1 LandAnimal and another WaterAnimal. There is another class Animal which wants to have the properties of both LandAnimal and WaterAnimal. How will you design this situation? KPIT3
What is interface and its use? HCL6
what is multitherading Tech-Mahindra2
How to set the Heap size in Java ? HCL2
what is auto boxing UHG1
what is mutability?which one is mutable String or StringBuffer?and why?give examples of each which shows the mutability of each String or StringBuffer  2
How to do validation of the fields in any project ?  2
what is session facade ?  2
Why we use static and synchronized in method for single thread model example: public static synchronized add(){}  1
Howmany address lines are required to addressing 1 MB memory?  3
Create a form of user Login in JSP, that accepts the user name and password from user and authenticate it with user names and passwords stored in database. (Plz provide me answer immediately)  1
How GUI component handle its own events?  1
 
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