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 |
Q) I have a ArrayList object, in that object i have added 5 integer values, 5 float values, 5 string values. Now question is how can delete particular type of data ( i.e all int values or all float values or string values) in that list object at a time?
Difference between start() and run() method of thread class?
strings in java are objects.why?
What is the use of callablestatement?
What is the different between get and post?
What is the access scope of a protected method?
What is garbage collector?
What is scope & storage allocation of static, local and register variables? Explain with an example.
Why is stringbuffer thread safe?
Is string a class?
Why sleep()is in Thread and wait() in Object class? Why can't I have both in one class or vice versa?
What are the benefits of java?