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


Please Help Members By Posting Answers For Below Questions

Why is string builder not thread safe?

587


What is a local, member and a class variable?

572


From the two, which would be easier to write: synchronization code for ten threads or two threads?

611


Is java a software?

511


Discuss different types of errors that generally occur while programming.

571






Which is bigger float or double java?

516


What is string :: npos?

573


What is class forname used for?

533


State one difference between a template class and class template.

614


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

1455


What is arguments in java?

515


What is the relationship between clipping and repainting under awt?

602


How big is a gigabyte?

611


What is unmodifiable collection in java?

503


Why map is used in java?

569