Why do inner class cannot have static declaration except
static nested class?
Answer Posted / vipul
Inner classes share a intimate relationship wth the outer
class which means to instantiate the inner class we need to
obtain the object of the outer class.in any case the inner
class contain any static member then we can access it only
with inner class name in that case we won't require its
object whch means we won't require the outer class
object.but java doesn't allow this if we want to access ny
if the inner class data member we must ahve outer class n
inner class object....queries r most welcomed..
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
What Is Composition?
What are the types of collections in java?
How to invoke external process in java.
Is java call by value?
How many types of assembly languages are there?
Can we rethrow the same exception from catch handler?
Explain hashset and its features?
Write an algorithm for quick sort?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
Can we define private and protected modifiers for variables in interfaces?
Explain the transient field modifier?
Why map is used in java?
How to split arraylist elements in java?
Can we declare an array without size in java?