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

Is an object null?

1022


What is serialization in java?

1106


What is meant by memory leak?

1152


Explain wait() method of object class ?

1285


What are the 8 data types in java?

1041


What is difference between length and length() method in java ?

1048


How can we use primitive data types as objects?

1000


How do you define a variable?

992


What is singleton class example?

1083


Can a hashset contain duplicates java?

1019


Mention some features of java?

1005


Why is stringbuffer faster than string?

959


What is downcasting?

1200


What is a parameter used for?

1005


Can we force garbage collector to run ?

1102