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
How a string is stored in memory?
Which is a valid identifier?
What is the purpose of the return statement?
What is difference between local variable and global variable?
What is the difference amongst jvm spec, jvm implementation, jvm runtime ?
How do you write a scanner class in java?
What are different exception types exceptions available in java ?
What is ternary operator?
What is the difference between math floor and math round?
How to stop a thread in java? Explain about sleep () method in a thread?
What is final?
What is a singleton class? Give a practical example of its usage.
Why for each loop is used?
Difference between operator overloading and function overloading
Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.