Please enable JavaScript.
Coggle requires JavaScript to display documents.
Inheritance/Hierarchy/Exceptions - Coggle Diagram
Inheritance/Hierarchy/Exceptions
Inheritance
allows new classes to be constructed on top of anothers
makes new class inherits data and methods from old class
If
PassCar
inherits
Car
class,then they have an
is
relationship
data abstraction
generic tasks are handled by generic classes, derived classes handle speciliazed tasks
re-usability
you can re-use methods and data from base classes to work on other specific tasks
public
members
are acessible
by derived classes
private
members
are not
acessible by derived classes
or indirect access through get methods
redefinition
if you redefine a member with the same name, it will mask that corresponding member
constructor
the base object constructor must be initialized
same for
destructor
implicit conversion
when you
assign
a
derived
class to a
base
class
Exception Handling
calling environment
central error handling
record an exception with the statement
throw
try block
includes code that can occur errors
catch block
defines a "type of error" with a exception handler
can be nested