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 is the difference between static and non-static
variables?

Answer Posted / santosh mundhe

Static:1)Memory allocated before creation of object.
2)Gets memory on Global segment.
3)Object can't get copy of static variable, each
object shears static variable from global segment.
4)Static variables are not part ob object.

Non-static:
1)Gets memory on satck segment.
2)Object gets copy of non static variable.
3)Non static variables are part of object.

Is This Answer Correct ?    8 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is hashmap and map?

964


What is widening and narrowing in java? Discuss with an example.

987


Can we override tostring method in java?

928


What is serial version uid and its importance in java?

989


How does arraylist work in java?

1040


Difference between process and thread?

990


What is an object’s lock and which object’s have locks?

892


Is integer a class?

1018


what is heap memory?

1038


What is return in java?

909


How do you declare a string variable?

957


What are inbuilt functions?

937


What does void * mean?

956


Difference between current previous versions of Java?

977


What access modifiers can be used for variables?

1073