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

Answers were Sorted based on User's Feedback



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

Answer / avadhut rane

Object is needed to access a non static data member

Is This Answer Correct ?    11 Yes 1 No

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

Answer / vijay

U cant call other class method without object.static member
is common for all object.if u want set some values for
specific object then the object is necessary

Is This Answer Correct ?    5 Yes 0 No

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

Answer / 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

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

Answer / viswa

The question is "when we can access the static data member
with out creating object?

To access a static member of data we no need to create an
object, using class name we can access that static data member.

What is the need of the object in java?

Object is required to access the instance variables as well
as instance methods in the class.With out the object we
can't access them.

Is This Answer Correct ?    7 Yes 2 No

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

Answer / arun kumar maurya

there is no need to create object for static data member
because they define in class and take memory at load
time.while non static required memory dynamically so object
creation is necessary for that.object is created to
allocate the memory while in the case of static memory
already created.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is the collection interface?

0 Answers  


Explain the difference between extends thread vs implements runnable in java?

0 Answers  


Explain jdk, jre and jvm?

0 Answers  


What is super in java?

0 Answers  


What is meant by Static query and Dynamic query?

2 Answers  


Which one will take more memory: an int or integer?

0 Answers  


Can substring create new object?

0 Answers  


What is integer parseint?

0 Answers  


What is an anonymous class in java?

0 Answers  


Where are register variables stored?

0 Answers  


what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent

0 Answers  


how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion... ANS:--- >executeupdate method is having boolean return type, if anything goes wrong in data insertion or data updation, it would return false. otherwise, if it successfully inserts data into the database, it would return true NOW HOW TO I CHECK IN MY DURING EXECUTION WHETHER IT RETURNS TRUE OR FALSE... WELL IT WILL DISPLAY ANY MESSAGE OR NOT

0 Answers   Google,


Categories