what is the difference between class and object?

Answer Posted / jayasrinivas.donavalli

class:class is an abstract data type in which both Member
functions and member variable are declared that means
aclass is userdefined data type in which we will be able to
declare both methods and variable.
object : Object is an Instance of the class.The class is a
valid one when object is created.
For one class we will have more number of Objects.
declaration of class in
class classname
{
public:
Member variables;
Member functions();
protected:
Member variables;
Member functions();
Private:
Member variables;
Member functions();
};
Declaration of Objects:
class classname allaisname;
here allias name is nothing but objectname.
if we want to get the data from that particular we have to
use objects.
objectname.functionname();

Is This Answer Correct ?    26 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is object in oops?

606


What do you mean by Encapsulation?

634


Is react oop?

603


What is interface? When and where is it used?

1656


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2091






How Do you Code Composition and Aggregation in C++ ?

24185


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2746


What is class and object in oops?

605


What is purpose of inheritance?

636


How do you achieve polymorphism?

605


What is the benefit of oop?

564


What is polymorphism oop?

610


What is oops in simple words?

571


What is polymorphism in oops?

550


What is a class oop?

584