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
What about features of local inner class?
What does || || mean in math?
What is the difference between menuitem and checkboxmenu item?
What do you understand by an io stream?
What is the maximum size of arraylist in java?
Explain what are final variable in java?
What is an empty string in css?
What are identifiers in java?
How do you add an element to a set in java?
How do I type unicode?
What is the use of callablestatement?
Explain about main thread in java?
define polymorphism in java
Is char * a string?
What languages are pass by reference?