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

What is the difference between conversation & casting?

1007


Can a class be defined inside an interface?

987


What is the default size of load factor in hashing based collection?

998


Can we create a constructor in abstract class?

942


Explain the difference between collection api and stream api in java8?

926


How do you sort words in java?

891


What are the advantages of java over C++?

1152


Which class cannot be a subclass in java?

965


Can you make a constructor final?

986


How do you create a reference in java?

923


How do you achieve polymorphism in java?

951


What 4 doubled?

931


What is ascii code?

1168


What is independent and dependent variables in research?

817


What is JDBC Driver interface?How can you retrieve data from the ResultSet

2054