Ch_7_Classes_And_Objects Flashcards
(38 cards)
::
Scope Resolution operator. It is needed to indicate class member functions and to inform the compiler which class it belongs to.
Member Function (Methods)
- A function that belongs to a class.
- The procedures that an object performs.
Class
- A programmer-defined data type used to define objects.
- The primary construct used to create objects.
Types of Member Functions (Methods)
- Acessor, get, getter function
-Mutator, set,setter function
Access Specifier
- Public or Private
- Specify which member variables and member function are accessible from inside and outside the class.
Data Hiding
- Refers to an object’s ability to hide its data from code outside the object.
- Only the object’s member functions can directly access and make changes to its data.
- An object typically hides its data, but allows outside code to access it through some of its member functions.
Encapsulation
Data and method together
Abstract Data Type
Any data type whose implementation details are kept separate from the logical properties needed to use it.
A data type that specifies the values the data type can hold and the operations that can be done on them without the details of how the data type is implemented.
Abstraction
A general model of something.
A definition that includes only the general characteristics of an object without the details that characterize specific instances of the object.
Data Abstraction
Separation of a data type’s logical properties from its implementation details.
Procedural Programming
A method of writing software centered on the procedures, or functions, that carry out the actions of the program.
Object Oriented Programming
A method of writing software that is centered on objects.
Objects
- A software entity that combines both data and the procedures that work with it in a single unit.
- Instances of a class.
Attributes
An objects data items. Stored in member variables.
Encapsulation
The bundling of an object’s data and procedures.
Instantiation
Defining a class.
Accessor (Get Functions; Getter)
A member function that USES the value of a class variable, but does not change it.
Mutator (Set Functions; Setter)
A member function which stores a value in a member variable, or changes its value.
Inline Function
Member functions that are defined within the class definition.
Function Implementation
A member function definition that is placed outside of the class declaration. A member function prototype will be placed in the class declaration.
Stale Data
Member data that has an external dependency and wasn’t changed when the dependency was changed.
Stack
Section of memory that holds the following when a regular function is called.
- Return address for when the function finishes executing.
- Values of the function arguments.
Constructor
A special PUBLIC member function that is automatically called when a class object is created.
Default Constructor
A constructor which has no parameters.