0% found this document useful (0 votes)
25 views

Functions Stand Alone and Methods Are Members of A Class

A class defines static attributes and behaviors that do not change, while an object is an instance of a class that can be created and destroyed and have changing attributes during its lifetime. Instantiation creates an object from a class declaration blueprint. A method is a member function of a class, while a function stands alone. A pure virtual method defines an abstract interface that cannot be instantiated.

Uploaded by

bigdinthehouse3
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Functions Stand Alone and Methods Are Members of A Class

A class defines static attributes and behaviors that do not change, while an object is an instance of a class that can be created and destroyed and have changing attributes during its lifetime. Instantiation creates an object from a class declaration blueprint. A method is a member function of a class, while a function stands alone. A pure virtual method defines an abstract interface that cannot be instantiated.

Uploaded by

bigdinthehouse3
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

class, object (and the difference between the two)

A Class is static. All of the attributes of a class are fixed before, during, and after the execution of
a program. The attributes of a class don't change.

The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class
at the time that it is created then it almost certainly will still belong to that class right up until the time
that it is destroyed.

An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also
during that lifetime, the attributes of the object may undergo significant change.

2. Instantiation

A class declaration is merely a template for what an object should look like. When you instantiate an
object, C++ follows the class declaration as if it were a blueprint for how to create an instance of that
object.

3. method (as opposed to, say, a C function)

Functions stand alone and methods are members of a class.

4. virtual method, pure virtual method

use pure for abstract class. Cannot instantiate. Used with polymorphism

5. class/static method
6. static/class initializer
7. constructor
8. destructor/finalizer
9. superclass or base class
10. subclass or derived class
11. inheritance
12. encapsulation
13. multiple inheritance (and give an example)
14. delegation/forwarding
15. composition/aggregation
16. abstract class
17. interface/protocol (and different from abstract class)
18. method overriding
19. method overloading (and difference from overriding)
20. polymorphism (without resorting to examples)
21. is-a versus has-a relationships (with examples)
22. method signatures (what's included in one)
23. method visibility (e.g. public/private/other)

You might also like