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


Please Help Members By Posting Answers For Below Questions

What does split function do in java?

623


Can you instantiate the math class?

710


What are basic keywords?

646


How can you read content from file in java?

671


What is isa relationship?

645






When is update method called?

763


Explain the significance of class loaders in bootstrap?

602


Define "Access specifiers" in java.

753


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

1694


Define a java class.

925


How can we run a java program without making any object?

635


Explain the difference between treeset and treemap in java?

625


Why main method is static in java?

700


What is a singleton class in Java?

602


Why generics are used in java?

650