What is an object?

Answer Posted / priya

OBJECT:
*OBJECT IS A RUN TIME ENTITY.
*IT CAN ACCESS THE CLASS MEMBERS.
*WE CAN CREATE AN OBJECT BY THE CLASS NAME.
EXAMPLE:
class myclass
{
public:
int no;
void getdata();
void putdata();

void getdata()
{
cin>>no;
}
void putdata()
{
cout<<"NO:";
}
};
void main()
{
myclass.obj1;[-----------> object was created by the class name]
obj1.getdata();
obj1.putdata();
getch();
}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does enum stand for?

607


What is oops?what is its use in software engineering?

553


What is the renewal class?

2161


Why is abstraction needed?

561


How does polymorphism work?

633






What is the example of polymorphism?

554


What is this pointer in oop?

549


What is and I oop mean?

615


can we make game by using c

3411


Can static class have constructor?

581


How is class defined?

580


Advantage and disadvantage of routing in telecom sector

781


Prepare me a program for the animation of train

1987


Why is polymorphism important in oop?

629


What is overloading and its types?

610