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

Answer Posted / mahesh_b.tech@2008

Non-static variables:

Instance block can be executed automatically when you were
creating the object.

Instance variables can be called by using with the object.

Instance variables can not called by using the class name.

memory will be alocated for instanse variables when you
create the object.

Static variables:

static block will be executed automatically when jvm(Java
Virtual Machine)loading the class into memory.

static varisble can be called using both objectname&class
name.

memory will be allocated when jvm loads the class.

Is This Answer Correct ?    13 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between set and map in c++?

1092


What is c++ redistributable?

1167


Is atoi safe?

1007


What is an incomplete type in c++?

1207


Comment on local and global scope of a variable.

1083


Can recursive program be written in C++?

1181


What is the use of endl?

918


What is string in c++ programming?

1107


Explain terminate() function?

1007


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

1045


Define macro.

1024


What gives the current position of the put pointer?

938


Explain the properties and principles of oop.

957


What is data type in c++?

967


What is static class data?

986