When is a memory allocated to a class?

Answer Posted / vineet makkar

The answer to this question lies in the basic difference
between
OBJECT & INSTANCE

INSTANCE : Refers to a reference of an object, it can be
null.

OBJECT: Actually pointing to the memory address of that
instance.

eg
Student stdnt; // Instance is created
Student stdnt = new Student; // Object is created

So, in short, memory is allocated to a class when the
object of the class is created using "new" keyword.

Is This Answer Correct ?    26 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is oop useful?

602


Is this job good for future? can do this job post grduate student?

1694


write a programe to calculate the simple intrest and compund intrest using by function overlading

1670


What is inheritance in oop?

604


Is data hiding and abstraction same?

569






What is pure oop?

599


Who invented oop?

659


What is encapsulation in oop?

609


What is super in oop?

599


what are the ways in which a constructors can be called?

1584


What does and I oop and sksksk mean?

654


Why interface is used?

555


What is oops in simple words?

585


Explain the advantages of inheritance.

675


What is pointer in oop?

539