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

What is nullpointerexception?

1072


What is the use of java?

961


Is empty .java file name a valid source file name?

1122


What is the independent variable in an experiment?

960


What is a treeset class?

1008


Can we increase array size dynamically in java?

947


Where local and global variables are stored?

1082


What is namespace in java?

1009


Which is best ide for java?

1044


What is the syntax and characteristics of a lambda expression? Explain

1045


What is the buffer limit?

1029


What are java packages? What is the significance of packages?

1014


Write the algorithm to check the number non-leaf nodes in a tree.

1075


How does list work in java?

913


extending thread class or implementing runnable interface. Which is better? : Java thread

999