Chapter 10 (Object Oriented Programming Pt.1) Flashcards

1
Q

a programming model that focuses on an application’s components (and the data and methods used in those components)

A

object oriented programming (OOP)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Items that a program will manipulate

A

Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

a group or collection of objects with common attributes

A

class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

an object is one _______ of a class.

A

instance / instantiation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

the actions that can be taken on an object

A

methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

this always begins with an uppercase letter and uses Pascal casing

A

ClassName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

the characteristics of an object

A

attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In OOP, ______ are also objects!

A

events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Every object instantiated from a given class possesses the same _________.

A

methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

a relationship that describes an object being an instance of a more general class

A

Is-a relationship

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

the data components of a class that belong to every instantiated object in that class

A

instance variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

These will oftentimes alter, use, or retrieve the attributes

A

Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Every object is an _______ of a more general class

A

instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

a program or class that instantiates objects of another prewritten class

A

class client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is another word for instance variable(s)?

A

Field(s)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The set of all the _______ or _______ of an object’s instance variables is its state.

A

values, contents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is another word for class client?

A

class user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The designation of a _____ is to help distinguish these variables from other variables you might use.

A

field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

In a GUI operating environment, you may write applications that have prewritten components from classes with names like “Window” and “Button”. This would be an example of a…

A

class user/class client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

When procedures operate differently using various objects, but the procedure is still called the same thing, this is an exmaple of…

A

Polymorphism

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Object-oriented languages understand methods in context of their _______, just as people understand verbs in context of their ______.

A

objects, nouns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

the process of acquiring the traits of one’s predecessors

A

Inheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

the process of combining all of an object’s attributes and methods into a single package

A

Encapsulation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Information Hiding is a concept that other classes should not alter an object’s ________, and that only the methods of an object’s own class should have that privelege.

A

attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
________ ______ should only be allowed to make a request that an attribute be altered.
Outside classes
26
What are the five integral components of OOP?
1. Class. 2. Objects. 3. Polymorphism. 4. Inheritance. 5. Encapsulation.
27
What is another phrase for information hiding?
Data hiding
28
This describes a group or collection of objects with common attributes.
a Class
29
A class definition must have ______
a name.
30
______ and ______ are portions of a class definition that are NOT required.
Data, methods
30
______ and ______ are portions of a class definition that are NOT required.
Data, methods
31
A set of program statements that lists the characteristics of each object and the methods each object can use.
Class definition
32
A larger section of ______ is reserved than when declaring a simple variable / using primitive data types, because a Class may contain several fields.
memory
33
This type's data is private and can be accessed only through methods.
Abstract Data Type (ADT)
34
simple numbers and characters
primitive data types
35
Programmers use these to plan or illustrate class features, and to describe a ____ to non-programmers.
Class diagram, class
36
What does this notation mean?: setLastName(name : string) : void Give 3 statements about it.
1. The method name is setLastName() 2. It takes a single string parameter named "name". 3. It returns nothing; hence, the "void".
37
These set or change the values of data fields defined within a class
Set method(s)
38
What is another phrase for a "set method"?
Mutator method
39
True or False: You can pass variables or named constants the methods, instead of literal constants, as long as they are the correct data type.
True
40
These provide a way to set a field value using a simpler syntax
Property/properties
41
The purpose of a ___ _____ is to return a value from the class to a client
Get method
42
Accessor method, work method, help method, and facilitator are all synonyms for...
Get method
43
True or False: You can declare an object locally within a method?
True
44
The adjective that defines the type of access outside classes will have to the attribute or method
access specifier
45
(-) vs (+)
Private access vs public access
46
_______ methods act as an interface to the private ____ _____; this is the KEY TENET OF ENCAPSULATION AND DATA HIDING.
Public, data fields
47
A method that works appropriately with different objects
Instance method
48
a "this reference" is implicitly passed to instance methods, and that reference becomes a _______ to each instance method.
parameter
49
True or False: A this reference must be explicitly declared.
False. It is an automatically created variable that holds the address of an object, and it is passed to an instance method whenever the method is called.
50
Static methods do not require...
a this reference
51
Static methods are the same thing as _____ methods.
class
52
Methods that exist to be used with an object; these methods act differently depending on the object used to call them.
Nonstatic method(s)
53
Methods for which no object needs to exist
Class methods
54
Methods in a class are generally ______ by default.
Nonstatic
55
Can you pass an object to a method?
Yes
56
Can you return an object from a method?
Yes
57
True or False: You can use arrays of objects similar as your would with any primitive data type.
True
58
When data cannot be accessed by any method that is not a part of the class; this has to be specified
Private access
59
When other programs and methods outside of the class can get access to private data.
Public access
60
Main() is virtually always...
public
61
A type that is not built into a language, but is created by an application's programmer
a user-defined type OR a programmer-defined type
62
This means the same thing as a field.
an instance variable
63
Which of the following does not belong with the others?: a. instance variable b. attribute c. object d. field
c. object
64
Encapsulation means that all the _______ and _______ are grouped together.
fields, methods
65
Are methods and data necessary for a class?
No, only the class name.
66
A _____ _______ provides an overview of a class's data and methods.
class diagram
67
Methods for which no objects need to exist; these are not instance methods, and they do not receive a this reference.
static methods
68
Inheritance is a type of...
is-a relationship.
69
The designation of a _____ (in a class) is to help distinguish these from other variables you might use throughout the program.
field
70
The set of all the values or contents of an object's instance variables is its ______.
state
71
True or False: Every object instantiated from a given class possess the same methods.
True
72
True or False: Declaring a class creates actual objects
False. A class is just an abstract description of what an object will be if any objects are actually instantiated.
73
After declaring an object, that object contains all of the ____ _____ and _______ defined in its class.
data fields, methods
74
A class is the ____ ____ of its objects. This is why programmer-defined types are considered Abstract Data Types (ADT)
data type
75
In a class diagram, the middle section contains the...
names and data types of the attributes.
76
Programmers use these to plan/illustrate class features before they use wireframes.
Class diagram
77
The purpose of a set method / _______ method, is to set or change the values of data fields as defined within the class.
mutator
78
True or False: When an attribute is contained in the same class as a method, the method has access to the field and can alter it.
True
79
A get method or ________ method's purpose is to return a value from the class to a client.
accessor - facilitator - help - work
80
A method that works appropriately with different objects because a "this reference" is implicitly passed to it.
Instance method
81
A "this reference" is a ________ to each instance method.
parameter
82
This is an automatically created variable that holds the address of an object that is passed to an instance method whenever the method is called.
This reference
83
True or False: You can use this references with local variables that are parameters to instance methods, or variables that are declared within method bodies.
False, a this reference can only be used with identifiers that are part of the class definition.
84
this.fieldName is an example of a...
this reference
85
Static / class methods do not require a this reference because they do not use any ____ _____ from a class; thus, it does not matter which object calls it.
data fields
86
A class method is a _______, because no objects need to exist for the method to work, as it does not use any data fields from the class.
misnomer
87
Methods in a class are generally ________ instance methods by default.
nonstatic
88
Object attributes or data
Fields
89
the data components that belong to every instantiate object; similar to a field
instance variables
90
Class methods (i.e. static methods) are NOT an ________ method, as they do NOT receive a this reference
instance