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...

Can you declare a static variable in a method?

Answer Posted / ali

No Static Variable cannot declare in method.
but the method present in class can access the static variable
of class.
Or the method which is trying to access the static variable of
class but method is not part of that class at that time declare method as static then it can access that static variable.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What steps are taken when the OS shifts from one-thread execution to another?

1410


What is the role of garbage collector in java?

1015


Can a constructor be protected?

1127


Explain the public class modifier?

994


Is singleton a bad practice?

1100


Is it necessary that each try block must be followed by a catch block?

1064


Why can't you declare a class as protected?

1203


When should the method invokelater() be used?

1068


What is java literals?

1200


Is 64bit faster than 32 bit?

1121


What is math in java?

1113


Explain restrictions for using anonymous inner classes?

1137


What is the effect of keeping a constructor private?

999


What is Applet Stub Interface ?

2558


What is a bubble sort in java?

999