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
Why is string builder not thread safe?
What is a local, member and a class variable?
From the two, which would be easier to write: synchronization code for ten threads or two threads?
Is java a software?
Discuss different types of errors that generally occur while programming.
Which is bigger float or double java?
What is string :: npos?
What is class forname used for?
State one difference between a template class and class template.
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea
What is arguments in java?
What is the relationship between clipping and repainting under awt?
How big is a gigabyte?
What is unmodifiable collection in java?
Why map is used in java?