what is the reason behind non static method cannot be
referenced from a static Context?

Answers were Sorted based on User's Feedback



what is the reason behind non static method cannot be referenced from a static Context?..

Answer / 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

what is the reason behind non static method cannot be referenced from a static Context?..

Answer / sadikhasan palsaniya

static variable and method refer to the class variable and
method and non static method can refer to particular object
and if static method can permit to access non static method
then how can recognize that method belong which object
that's why not accessible.

if any mistake welcome and correct me!!!!!

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is java object name?

0 Answers  


How is string immutable in java?

0 Answers  


How do you check if a string is lexicographically in java?

0 Answers  


what are the difference between Java and .Net?

5 Answers  


What is void data type?

0 Answers  






If I have 1000 objects and my requirement is to sort them quickly, then which collection would you recommend and why?

5 Answers   KPIT,


What is difference between path and classpath?

0 Answers  


Is sizeof a keyword in java programming?

0 Answers  


What is port number in java?

0 Answers  


Describe the process as to how substring() methodology mechanisms in java.

0 Answers  


What is meant by tab pans?

0 Answers  


What is a finally block?

0 Answers  


Categories