what is inner class?

Answer Posted / ranganathkini

An inner class is a class that is defined within the
definition of another class but outside any member
definition. Inner classes shud not be marked static.

An Inner class cannot be instantiated directly, i.e. one can
only instantiate an inner class by first instantiating the
outer class.

The Inner class has access to all the static as well as
non-static public/protected/private fields of its enclosing
outer class.

Inner classes are used to provide implementation that are
intimately connected with the enclosing outer class.

Is This Answer Correct ?    39 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

552


What is the tradeoff between using an unordered array versus an ordered array?

657


If a class is declared without any access modifiers, where may the class be accessed in java programming?

651


What is difference between protected and private?

526


What is an infinite loop in java? Explain with an example.

586






Why is the singleton pattern considered to be an anti pattern?

471


Is cout buffered?

682


What is a protected void?

502


Which is the best sorting technique in java?

518


Explain about procedural programming language or structured programming language and its features?

544


Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx

1601


What is static data type in java?

540


What is the difference between a vector & an array list?

674


what is mena by object block any what is the use of that

1770


what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent

1727