Abstraction Flashcards
Denotes the essential characteristics
of an object that distinguish it from
all other kinds of objects providing
well-defined boundaries, relative to
the perspective of the viewer
Abstraction
Benefits of Abstraction:
Simplifies the process: Helps us deal with
complexity
Defined scope: Provides a basis for deciding
which features are important and which are
not (depending on the context)
A set of objects that share
common attributes and
common methods (collectively known as ‘features’) and these features are defined in the class specification
Class
a document that serves as a
template or blueprint that
dictates how to create new
object instances of a class
Class Specifications
The process of creating an object based on
a class
Instantiation
A specialized method for instantiating an
object of a class as well as initializing its
state
Constructor
TRUE or FALSE:
There can be more than one constructor in
a class specification
TRUE
The keyword _____ is a reference to the current
object.
this
A specialized method for destroying an instance of a class
Destructor
TRUE or FALSE:
You can create destructors in Java
FALSE
Java does not support destructors; it is the job of the
garbage collector present in the Java Virtual Machine to free
up memory allocated to instances that are no longer in use
are software self-contained programming unit packaged with an enclosed data/data structure and methods that operate on the data
Objects
Abstraction Design Tips:
1) Find the Main Actors in the problem domain
2) Class names should reflect their responsibilities
3) Break up classes that have too many responsibilities
TRUE or FALSE:
If no constructor is specified, the compiler creates the default constructor.
TRUE