what is an object and how do you allocate memory to it?

Answer Posted / sunitha

It is an instance of class or run time entity which binds
data members and methods together.
example:
car
Attributes(state of the object)

name, no. make , price, mileage.

Methods (Behavior of the object): start, stop,
Accelerate,
By using new operator we can allocate memory to object.

by using constructions we can allocate memory directly
here we no need to use new operator . for deal location of
memory we can use destruction's .

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is number data type in java?

558


How do I enable java in safari?

549


Can a abstract class be declared final?

569


What is the latest java version?

561


What is the difference between math floor and math round?

504






How many threads does a core java have?

511


Differences between external iteration and internal iteration?

577


What is hashmap and map?

559


How to change the priority of thread or how to set priority of thread?

568


Can a java program have 2 main methods?

549


What is type parameter in java?

522


Is it necessary that each try block must be followed by a catch block?

559


What is a linkedhashmap java?

555


What is a war file?

550


What is charat ()?

529