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 is a Null object?

892


What are the rules for variable declaration?

506


How many decimal places is a double?

540


Why is whitespace important?

557


How variables are stored in memory?

541






how does the run() method in runnable work? : Java thread

516


What is the meaning of variable in research?

561


What is bubble sort in java?

619


How a string is stored in memory?

581


Is 0 a real number?

590


Can you inherit a constructor java?

578


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

601


What is difference between arraylist and list in java?

585


What is java in layman terms?

530


Is there is any difference between a scrollbar and a scrollpane?

564