Why do inner class cannot have static declaration except
static nested class?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / adithya
Static have only one copy in memory. For class we have to
create objects. But for static we cannot create.
| Is This Answer Correct ? | 7 Yes | 9 No |
What are the differences between abstract class and interface?
If an application has multiple classes in it, is it okay to have a main method in more than one class?
Can you call a method in a method?
what are the different access specifiers that can be used by interfaces and abstract classes? can anyone give me detailed description on this
11 Answers IBM, L&T,
What is the purpose of the return statement?
Map map = new HashMap(2); map.add(“1”,”one”); map.add(“2”,”two”); map.add(“3”,”three”); What will happen at this line?
What are the parts of methodology?
In java, how we can disallow serialization of variables?
Where will it be used?
What is the right data type to represent a price in java?
Which class has no duplicate elements?
What is array in java?