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...

When we can access the static data member without creating
the object what is the need of the object in java.

Answer Posted / paras bist

Static data is class level data,while objects contain
values of non static instancs varibles.
diffrent object contains diffrent values of instance
varibles ,
but all object can share same vale of static data.

Class abc{
int i;
int j;
static int x=10;
//-----some more code
}

diffrent object contain diffrent values of i&j,
but all object can share one value of x(ie 10 coz it is
static).

static data is accessed by class name and object also.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Will the jvm load the package twice at runtime?

1040


Where are global variables stored?

884


Is the milky way in a void?

912


What is replacefirst in java?

1021


Explain the selection sort algorithm and state its time complexity?

962


What is default exception handling in java?

971


Is it possible for a yielded thread to get chance for its execution again?

889


What type of value does sizeof return?

950


If an application has multiple classes in it, is it okay to have a main method in more than one class?

965


What is static block?

1057


How can we find the actual size of an object on the heap?

1259


Can we write class inside a class in java?

919


What is equals method in java?

977


What are the special characters?

927


Why string is called as immutable?

887