Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

In how many ways we can do exception handling in java?

937


How do I enable java in safari?

982


Can we call the run() method instead of start()?

986


How will you print number in reverse (descending) order in BST.

944


When should a function throw an exception?

993


How are multiple inheritances done in Java?

1092


What is complexity in java?

965


What is the use of parse function in java?

924


What is keyword in oop?

917


What is map in java?

947


Is a method a function?

1007


What is difference between hashset and hashmap in java?

944


How do you know if a value is nan?

1011


Is java free for commercial?

864


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

939