answersLogoWhite

0


Best Answer

Class in C++ is just the same meaning as in any other OO(object-oriented) languages. In the world of OO, anything are classes, which have properties, function to work. In other words, class is a method to organize things to work together.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

A C++ class is the definition of a complex data type. The definition both declares and implements the member attributes and member methods of the class. the attributes describe the data members of the class while the methods describe the operations upon those attributes, how they are initialised during instantiation of the class, how they are mutated and retrieved (setters and getters), and how they are destroyed when the instance falls from scope.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

A generic class is a class that contains one or more virtual methods and is intended to act as a base class for more specific, specialised classes, known as derivatives or derived classes. A generic class that has one or more pure virtual methods is also known as an abstract base class or abstract data type.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

A derived class is any class that inherits from another class (known as a base class). Derived classes can inherit from several base classes (multiple inheritance). Base classes may themselves be derived from other classes. Each derivative expands upon the functionality of its base class, making it more specialised.

Derived classes inherit all the public and protected members of their base classes, except the constructors. Friends of base classes are not inherited either.

An example of class inheritance declaration:

class myDerivedClass : public myBaseClass

{

public:

myDerivedClass();

};

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Class implementation basically means the definition of a class, as opposed to its declaration. Although the definition and declaration can appear in the same file, this usually only applies to trivial classes or trivial methods of the class.

Class declarations and definitions are normally separated into header files (declarations) and source files (implementations). Clients of the class need only include the header to actually use the class. However 3rd-party classes are often distributed as libraries, which require a header, which must be included to provide the declaration, and a .lib file containing the implementation that must be linked to your program.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Class templates are used to create classes that operate on a type, without having to write separate classes to cater for each type the class could operate upon.

For instance, suppose we have two classes, where one has an integer member while another has a float, but both classes operate on those members in exactly the same way. Functionally, they are no different -- the only difference being the type. Without class templates, we'd be forced to write the two classes out in full, even though the code is exactly the same for both (other than the member type, of course).

With class templates, we can pass the type as a template argument and let the compiler generate the actual class for us. This way we only have one class to maintain (with no duplicate code to maintain) and we can re-use the template class for any other type, including structures and other classes, without having to duplicate any code to cater for these new types.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

A subclass is a class that is derived from a base class. The subclass is commonly referred to as a derived class.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is sub classing in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp