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 release of java technology are currently available what do they contain?
Why java is platform independent? Explain.
What are void pointers?
How do you compare two strings lexicographically?
How do you invoke a method?
as we know a static method could access static data and static method only. then how could main method call the object of aclass which is not static and other non static data
How can two threads be made to communicate with each other?
can we take more than one null values for Unique constraints.
What is var keyword ?
they asked class A{} class B{} class c{} all the three class saved as a single file,there is no main method in the file and anothe class M.java class m { psvm(String args[]) { // here the parent class can access } }
2 Answers DNS, IPSR Solutions,
How do you declare an array in java?
can two class in a code be public??if yes then how??