Question :What is the disadvantage of using an inner class? (CoreJava)
Answer :Java bytecode has no concept of inner classes, so the compiler translates
inner classes into ordinary classes that are
accessible to any code in the same package. An inner class gets access to
the fields of the enclosing outer class-even if
these fields are declared private and the inner class is translated into a
separate class. To let this separate class
access the fields of the outer class, the compiler silently changes these
fields' scope from private to package. As a
result, when you use inner classes, you not only have the inner class
exposed, but you also have the compiler silently
overruling your decision to make some fields private.
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Thursday, March 12, 2009
What is the disadvantage of using an inner class? (CoreJava)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment