
Patrick B. answered 03/23/21
Math and computer tutor/teacher
(1)
Class is a set of data and functions , called METHODS,
that OPERATE on the data
Each piece of data is called a DATA MEMBER,or MEMBER VARIABLE.
Each Function Method is called a METHOD or MEMBER FUNCTION.
(2) Local vars: declare INSIDE the body of the function.
Class variable: one of the Member variables
Instance: a variable of the class type; such instance
is called an OBJECT
(3) Constructor: allows the data members to be initialized,
memory allocated, and values set so that
the object is ready to go and can be used
Destructor: clears the data members and FREEs allocated
memory when the object is no longer needed..
(about to go out of scope)
(4) Local object:
Class_name obj_name( paramters);
Pointer to object:
Class_name * ptr_to_obj_name = new Class_name(paramters)
(5) public methods called GETTERS are written to
return COPIES of the data to the caller;
public methods called SETTERS are written to
Set the values of the data in the class;