Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
52 Cards in this Set
- Front
- Back
abstract data type
|
another name for class
|
|
aggregation
|
special form of association that represents an ownership relationship between two objects; models has-a relationships; represented with an empty diamond
|
|
boxing
|
converting a primitive value to a wrapper object
|
|
class abstraction
|
separates class implementation from how the class is used
|
|
class encapsulation |
details of class implementation are encapsulated and hidden from the user
|
|
class's contract
|
collection of methods and fields that are accessible from outside the class, together with the description of how these members are expected to behave
|
|
composition
|
when an object is exclusively owned by an aggregating object; represented with a filled in diamond
|
|
|
relationship representing ownership; aggregation
|
|
multiplicity |
may be specified by each class involved in an association; placed at the side of the class to specify how many of the class's objects are involved in the relationship in UML
|
|
stack |
a data structure that holds data in a last-in, first-out fashion
|
|
unboxing
|
converting a wrapper object to a primitive value
|
|
procedural paradigm
|
focuses on designing methods
|
|
object-oriented paradigm
|
couples data and methods together into objects |
|
association
|
general binary relationship that describes an activity between two classes |
|
aggregating object
|
owner object in aggregation whose class is aggregating class
|
|
aggregated object
|
subject object in aggregation whose class is aggregated class
|
|
wrapper classes
|
way to incorporate a primitive data type into an object
|
|
immutable
|
wrapper classes; BigInteger and BigDecimal classes; String objects |
|
radix
|
|
|
autoboxing
|
when the compiler automatically boxes a primitive value that appears in a context requiring an object
|
|
autounboxing
|
when the compiler automatically unboxes an object that appears in a context requiring a primitive value |
|
interned string
|
String s1 = "Welcome to Java"; String s2 = new String("Welcome to Java"); String s3 = "Welcome to Java"; s1==s2: false s1==s3: true |
|
regular expression (regex)
|
a string that describes a pattern for matching a set of strings |
|
StringBuilder vs. StringBuffer
|
similar classes where one has synchronized methods (only one task is allowed to execute the methods) |
|
inheritance
|
defining new classes from existing classes; models an is-a relationship |
|
subclass
|
a class C1 extended from a class C2; child, extended, or derived class; not a subset-includes more methods |
|
superclass
|
a class C2 that has class C1 extended from it; parent or base class |
|
private data fields
|
cannot be accessed outside their class except through getters and setters |
|
single inheritance
|
Java class may inherit directly from only one superclass
|
|
super keyword
|
refers to the superclass and can be used to invoke the superclass's methods and constructors |
|
method overriding
|
when a subclass modifies the implementation of a method defined in the superclass; same signature/return type; reside in different classes related by inheritance instance method only if accessible static method cannot be-superclass method becomes hidden |
|
method overloading
|
multiple methods with the same name but different signatures/parameters; reside in the same or different classes related by inheritance |
|
Object class
|
where every class in Java is descended from |
|
polymorphism
|
a variable of a supertype can refer to a subtype object |
|
three pillars of object-oriented programming
|
encapsulation, inheritance, and polymorphism |
|
declared type
|
the type that declares a variable |
|
actual type
|
the actual class for the object referenced by the variable |
|
dynamic binding |
a method can be implemented in several classes along the inheritance chain; invoked method is determined by the variable's actual type
|
|
casting object
|
one object reference can be typecast into another object reference |
|
implicit casting
|
Object o = new Student();
|
|
explicit casting
|
Student b = (Student)o; |
|
upcasting
|
casting an instance of a subclass to a variable of a superclass |
|
downcasting |
casting an instance of a superclass to a variable of its subclass; explicit casting must be used
|
|
equals method
|
|
|
==
|
compares two primitive data type values; determines whether two objects have the same references |
|
type inference
|
the compiler identifies the type from the variable declaration
|
|
visibility of data and methods
|
private->default->protected->public |
|
public modifier
|
accessed from the same class; accessed from the same package; accessed from a subclass in a different package; accessed from a different package |
|
protected modifier
|
accessed from the same class; accessed from the same package; accessed from a subclass in a different package
|
|
default modifier
|
accessed from the same class; accessed from the same package
|
|
private modifier
|
accessed from the same class |
|
final modifier
|
prevents classes from being extended |