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 / vijayakumar chinnasamy

No static variable cannot be declared within static/non-
static method.

only "final" and "default" allowed within in method for
variable declaration. i.e u cant use
private,protected,public,static within method .it display
the compile time error "Illegal modifier".

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Lowest Common ancestor in a Binary Search Tree and Binary Tree.

978


What is a ?

1268


What are wrapped classes in java programming?

1099


Can you have two constructors in java?

1045


Can we have multiple classes in a single file?

1024


What is heterogeneous in java?

1021


Can this keyword be used to refer static members?

1072


Explain different ways of creating a thread?

1113


how to handle exceptions in ejb?

2362


What do you mean by object?

1029


Can we increase array size dynamically in java?

1008


What is polymorphism java example?

1063


what is object-oriented programming in java?

1102


What is the default size of arraylist in java?

1191


What is string :: npos?

1173