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 are field variable and local variable?

Answer Posted / ranganathkini

Variables declared outside any method/constructor but inside
the class block, is a field variable.

Variables that are declared within a method or a specific
block of statements are local variables.

Local variables are kept alive as long as the execution is
within the block they're defined in. Once the block is
exited, the local variables can no more be used.

Field variables have longer life than local variables in
that they can live as long as the instance they belong to is
active.

Is This Answer Correct ?    30 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java command?

1013


What is private static in java?

995


What is token in java?

957


Name container classes in java programming?

1023


What do you mean by checked exceptions?

897


Explain listiterator and methods in listiterator?

956


What is the difference between procedural and object-oriented programs?

924


What is parse method?

957


What are the different types of sorting in java?

929


What is command line argument

1150


Can I override protected method in java?

1017


What is the difference between overriding & overloading?

1002


What is an arraylist in java?

985


Is arraylist sorted in java?

944


What is constructor and its types?

1055