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

Why do we need autoboxing in java?

986


How do you check if an arraylist is not empty?

1113


How does a for loop work java?

1029


What does microservices mean?

940


What is cr keyboard?

1235


How to reverse a string in java?

1068


What is singleton math?

1121


How can I become a good programmer?

975


What's the difference between comparison done by equals method and == operator?

964


If try block is successfully executed, Then Is Finally block executed?

1079


What are thread safe functions?

944


What is the difference between compiler and jvm?

1047


Does list maintain insertion order java?

904


Which object oriented concept is achieved by using overloading and overriding?

1100


What is the method to expand and collapse nodes in a jtree?

1039