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 do you mean by static variable?

1064


Can final class have constructor?

926


What defines function?

978


Can the garbage collection be forced by any means?

993


Can we have two main methods in a java class?

1054


How to implement an arraylist in java?

1155


What is bufferedreader in java?

1046


How do you achieve singleton?

980


What is a private class in java?

1053


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

1114


Tell some latest versions in JAVA related areas?

984


What is the purpose of methodology?

1080


What is a java applet? What is an interface?

1098


What is the private method modifier?

1089


What is final access modifier in java?

1147