whats the working of classes and objects in c++??
vivekv:
class will work with collection of method & function.they will working in that all collection use in any time. one specific
Answers
Answered by
1
A class is used to specify the form of an object and it combines data representation and methods for manipulating that data into one neat package. The data and functions within a class are called members of the class.
An object is an instance of the class which can define the class
An object is an instance of the class which can define the class
Answered by
2
The mechanism that allows you to combine data and function in a single unit is called a class.once a class is defined,you can declare variable of that type.once an object is declared,it can access the public members of the class.
A class variable is called object or instance.
in other words,a class would be the data type and the object would be the variable type.
classes are generally declared using the key word class,with following format:
classclass_name
{
private:
members 1;
protected:
members 2;
public:
members 3;
};
A class variable is called object or instance.
in other words,a class would be the data type and the object would be the variable type.
classes are generally declared using the key word class,with following format:
classclass_name
{
private:
members 1;
protected:
members 2;
public:
members 3;
};
Similar questions