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
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
How do you escape json?
What about anonymous inner classes in java?
Can we compare two strings in java?
What about main thread in java?
What is replaceall in java?
What is the different types of functions?
Why java is a platform independent? Explain
Why arraylist is not synchronized in java example?
What are the methods of object class ?
Can we sort array in java?
What is role of void keyword in declaring functions?
What are 5 boolean operators?
How are java objects passed to a method and what are native methods?
How do you identify independent and dependent variables?