Chapter 3 Flashcards
Abstraction
The ability to ignore details of parts to focus attention on a higher level of a problem
modularization
Process of dividing a whole into well-defined parts which can be built and examined separately, and which interact in well defined ways
Classes define ___
types. A class name can be used as the type for a variable. Variables that have a class as their type can store objects of that class.
What are the 2 types in Java?
primitive and object types
Primitive type
- stored directly in variable
- non-object type
- Types suchas int, boolean, char, double, and long are the most common primitive types.
- Primitive types have no methods.
- pre-defined in the java language
object types
- not stored directly in variable but the reference of the object is stored (object references)
- defined by classes
Internal method call
- no variable name required
- method is in the same class as the call of the method
- syntax:
methodName(parameter-list)
ie.
updateDisplay();
External method call
- method call to a method of another object using dot notation
- syntax:
object.methodName(parameter-list)
ie.
minutes.increment();
object.methodName(parameter-list)
this syntax is know as___
dot notation:
It consists of an object name, a dot, the method name, and parameters for the call
name overloading
- the same name being used for 2 different entities.
- a class may contain more than one constructor, or more than one method of the same name, as long as each has a distinctive set of parameter types
What keyword is used in the case of name overloading to refer to the field instead of the closest parameter?
“this” such as:
this.from
“this” refers to current object so this particular “this” refers to the “from” field in the current object.
class diagram
- shows the classes of an application and the relationships b/t them
- gives info about the source code
- presents static view of a program
object diagram
- shows the objects and their relationships at one moment in time during the execution of an application
- gives info about objects at runtime and presents the dynamic view of a program
&&
Logical “and” operator that causes the condition in the if-statement to be true if both the conditions on either side of the “&&” symbol are true
What are the 3 most important logical operators?
and, or and not