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
What is a treemap in java?
What are the differences between the constructors and methods?
What is the difference between state-based unit testing and interaction-based unit testing?
Write a program to solve producer consumer problem in java?
Which collection is thread safe in java?
List primitive java types?
What will be the initial value of an object reference which is defined as an instance variable?
What is integers and example?
What is java autoboxing?
What are the methods of object class ?
What is an empirical question?
What are functions in java?
Convert a BST into a DLL and DLL to BST in place.
Is a class an object?
Explain different types of wrapper classes in java?