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
Q

________ ______ should only be allowed to make a request that an attribute be altered.

A

Outside classes

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

What are the five integral components of OOP?

A
  1. Class.
  2. Objects.
  3. Polymorphism.
  4. Inheritance.
  5. Encapsulation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is another phrase for information hiding?

A

Data hiding

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

This describes a group or collection of objects with common attributes.

A

a Class

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

A class definition must have ______

A

a name.

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

______ and ______ are portions of a class definition that are NOT required.

A

Data, methods

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

______ and ______ are portions of a class definition that are NOT required.

A

Data, methods

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

A set of program statements that lists the characteristics of each object and the methods each object can use.

A

Class definition

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

A larger section of ______ is reserved than when declaring a simple variable / using primitive data types, because a Class may contain several fields.

A

memory

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

This type’s data is private and can be accessed only through methods.

A

Abstract Data Type (ADT)

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

simple numbers and characters

A

primitive data types

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

Programmers use these to plan or illustrate class features, and to describe a ____ to non-programmers.

A

Class diagram, class

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

What does this notation mean?:
setLastName(name : string) : void
Give 3 statements about it.

A
  1. The method name is setLastName()
  2. It takes a single string parameter named “name”.
  3. It returns nothing; hence, the “void”.
37
Q

These set or change the values of data fields defined within a class

A

Set method(s)

38
Q

What is another phrase for a “set method”?

A

Mutator method

39
Q

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.

40
Q

These provide a way to set a field value using a simpler syntax

A

Property/properties

41
Q

The purpose of a ___ _____ is to return a value from the class to a client

A

Get method

42
Q

Accessor method, work method, help method, and facilitator are all synonyms for…

A

Get method

43
Q

True or False: You can declare an object locally within a method?

44
Q

The adjective that defines the type of access outside classes will have to the attribute or method

A

access specifier

45
Q

(-) vs (+)

A

Private access vs public access

46
Q

_______ methods act as an interface to the private ____ _____; this is the KEY TENET OF ENCAPSULATION AND DATA HIDING.

A

Public, data fields

47
Q

A method that works appropriately with different objects

A

Instance method

48
Q

a “this reference” is implicitly passed to instance methods, and that reference becomes a _______ to each instance method.

49
Q

True or False: A this reference must be explicitly declared.

A

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
Q

Static methods do not require…

A

a this reference

51
Q

Static methods are the same thing as _____ methods.

52
Q

Methods that exist to be used with an object; these methods act differently depending on the object used to call them.

A

Nonstatic method(s)

53
Q

Methods for which no object needs to exist

A

Class methods

54
Q

Methods in a class are generally ______ by default.

55
Q

Can you pass an object to a method?

56
Q

Can you return an object from a method?

57
Q

True or False: You can use arrays of objects similar as your would with any primitive data type.

58
Q

When data cannot be accessed by any method that is not a part of the class; this has to be specified

A

Private access

59
Q

When other programs and methods outside of the class can get access to private data.

A

Public access

60
Q

Main() is virtually always…

61
Q

A type that is not built into a language, but is created by an application’s programmer

A

a user-defined type OR a programmer-defined type

62
Q

This means the same thing as a field.

A

an instance variable

63
Q

Which of the following does not belong with the others?:

a. instance variable
b. attribute
c. object
d. field

64
Q

Encapsulation means that all the _______ and _______ are grouped together.

A

fields, methods

65
Q

Are methods and data necessary for a class?

A

No, only the class name.

66
Q

A _____ _______ provides an overview of a class’s data and methods.

A

class diagram

67
Q

Methods for which no objects need to exist; these are not instance methods, and they do not receive a this reference.

A

static methods

68
Q

Inheritance is a type of…

A

is-a relationship.

69
Q

The designation of a _____ (in a class) is to help distinguish these from other variables you might use throughout the program.

70
Q

The set of all the values or contents of an object’s instance variables is its ______.

71
Q

True or False: Every object instantiated from a given class possess the same methods.

72
Q

True or False: Declaring a class creates actual objects

A

False. A class is just an abstract description of what an object will be if any objects are actually instantiated.

73
Q

After declaring an object, that object contains all of the ____ _____ and _______ defined in its class.

A

data fields, methods

74
Q

A class is the ____ ____ of its objects. This is why programmer-defined types are considered Abstract Data Types (ADT)

75
Q

In a class diagram, the middle section contains the…

A

names and data types of the attributes.

76
Q

Programmers use these to plan/illustrate class features before they use wireframes.

A

Class diagram

77
Q

The purpose of a set method / _______ method, is to set or change the values of data fields as defined within the class.

78
Q

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.

79
Q

A get method or ________ method’s purpose is to return a value from the class to a client.

A

accessor - facilitator - help - work

80
Q

A method that works appropriately with different objects because a “this reference” is implicitly passed to it.

A

Instance method

81
Q

A “this reference” is a ________ to each instance method.

82
Q

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.

A

This reference

83
Q

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.

A

False, a this reference can only be used with identifiers that are part of the class definition.

84
Q

this.fieldName is an example of a…

A

this reference

85
Q

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.

A

data fields

86
Q

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.

87
Q

Methods in a class are generally ________ instance methods by default.

88
Q

Object attributes or data

89
Q

the data components that belong to every instantiate object; similar to a field

A

instance variables

90
Q

Class methods (i.e. static methods) are NOT an ________ method, as they do NOT receive a this reference