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

Templates mean

1834


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

1871


What are main features of oop?

872


Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

2827


Why is object oriented programming so hard?

828


Why do we use inheritance?

822


What are the types of abstraction?

775


What is overloading and its types?

825


What is encapsulation and abstraction? How are they implemented in C++?

847


Can static class have constructor?

787


What is an example of genetic polymorphism?

870


Get me a number puzzle game-program

1929


What is the difference between a constructor and a destructor?

853


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1619


What is the use of oops?

796