what is the reason behind non static method cannot be
referenced from a static Context?
Answer Posted / srinivaskumar.nimmana
static method or static variable has special memory called context of class. it is allocate before execution. but in case of non-static method memory allocate at the time of executing.
so clearly static method is first loaded at the time of static method loading non-static method is not available to the static method because it is not loaded.
when non-static is loaded at that time static is already loaded.so static method is always available to non-static vice versa not possible
Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
describe synchronization in respect to multithreading? : Java thread
Can you give few examples of final classes defined in java api?
What is the difference between procedural and object-oriented programs?
How would you format a date in java? I.e. In the ddmmyyy format?
Does apple use java?
What is the difference between java applets and applications?
What is math floor in java?
What is the longest unicode character?
What is the base class of all exception classes in java?
What is a method in java?
Does substring start with 0?
Can we modify the throws clause of the superclass method while overriding it in the subclass?
What is meant by memory leak?
What is a double?
What is static import in java?