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


why we cannot declare static variable inside a static method

Answers were Sorted based on User's Feedback



why we cannot declare static variable inside a static method..

Answer / ravikiran

Because all the variales inside static method are by
default static

Is This Answer Correct ?    15 Yes 4 No

why we cannot declare static variable inside a static method..

Answer / srinu

generally all variables inside static method treated as
static

Is This Answer Correct ?    9 Yes 3 No

why we cannot declare static variable inside a static method..

Answer / sachin kanojiya

Static variable initializes at the time of class load
(static variable initialize very first,after that static
method)that means static variable and method already define
but inside the static method can't declare static variable
because it is treat as static local member...

Is This Answer Correct ?    5 Yes 4 No

why we cannot declare static variable inside a static method..

Answer / swamireddy

STATIC VARIABLES ARE DECLARED CLASS DIFINITION ONLY
WITHOUT DECLARE THE WITHIN STATIC METHODS.THE STATIC
METHODS ARE ONLY USE THE STATIC VARIABLES.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Core Java Interview Questions

What is difference between char array and string?

0 Answers  


What are Inner classes?

4 Answers  


What do you mean by formatting?

0 Answers  


What is the importance of hashcode() and equals() methods?

0 Answers  


what is aberivation of java?

14 Answers  


What happens when a main method is declared as private?

22 Answers   DELL, Infosys, L&T, Sun Microsystems,


What is the benefit of using enum to declare a constant?

0 Answers   Aspire, Infogain,


what are depricated methods in threads and explain the lifecycle methods

5 Answers   CTS,


Explain the importance of throwable class and its methods?

0 Answers  


Why are constructors used?

0 Answers  


How to sort array in descending order in java?

0 Answers  


What do you mean by JVM?

0 Answers   Ericsson,


Categories