Programing Logic ch10

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

30 Terms

1
New cards

Object-oriented programming (OOP):

A programming model that focuses on an application’s components and data and the methods to manipulate them.

2
New cards

Class:

Describes a group or collection of objects with common attributes.

3
New cards

Object:

One instance of a class. Sometimes called one instantiation of a class. When a program creates an object, it instantiates the object.

4
New cards

Attributes:

Characteristics that define an object as part of a class.

5
New cards

Class Methods:

Actions that alter, use, or retrieve the attributes.

6
New cards

Is-a relationship:

“My oak desk with the scratch on top is a Desk”

7
New cards

Class’s instance variables:

Data components of a class that belong to every instantiated object, Often called fields.

8
New cards

State:

A set of all the values or contents of a class object’s instance variables.

9
New cards

Every object that is an instance of a class possesses the same

methods.

10
New cards

Class client or class user:

A program or class that instantiates objects of another prewritten class.

11
New cards

The world is full of objects.

A door is an object that needs to be open or closed. But an “open” procedure works differently on different objects, Open a door, Open a drawer, Open a bank account. One “open” procedure can open anything if it gets the correct arguments.

12
New cards

Polymorphism occurs when

the same method name works appropriately for different object types.

13
New cards

Inheritance:

The process of acquiring the traits of one’s predecessors.

14
New cards

Encapsulation:

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

15
New cards

Information hiding (also called data hiding):

Other classes should not alter an object’s attributes.

16
New cards

Declaring a class does not

create any actual objects.

17
New cards

After an object is instantiated

Methods can be accessed using an identifier, a dot, and a method call.

18
New cards

when programmers call the classes they write

user-defined types. More accurately called programmer-defined types. OOP programmers call them abstract data types (ADTs). Simple numbers and characters are called primitive data types.

19
New cards

Set method (also called mutator method):

Sets the values of data fields within the class. No requirement that such methods start with the set prefix. Some languages allow you to create a property to set field values instead of creating a set method.

20
New cards

Get method (also called accessor method):

Purpose is to return a value to the world outside the class. Value returned from a get method can be used as any other variable of its type would be used.

21
New cards

Work method (also called help method, or faciltator):

performs tasks within a class.

22
New cards

private access:

Data cannot be accessed by any method that is not part of the class.

23
New cards

Public access:

Other programs and methods may use the methods that control access to the private data.

24
New cards

Access specifier:

An adjective defining the type of access that outside classes will have to the attribute or method. Also called an access modifier.

25
New cards

Instance method:

Method that works appropriately with different objects. If you create 100 Students and assign grade point averages to each of them, you would need 100 storage locations in computer memory.

26
New cards

this reference:

An automatically created variable. Holds the address of an object. Passes it to an instance method whenever the method is called. Refers to “this particular object” using the method. Implicitly passed as a parameter to each instance method.

27
New cards

Static methods (also called class methods):

Methods for which no object needs to exist.

28
New cards

Nonstatic methods:

Methods that exist to be used with an object.

29
New cards

You can use objects

like you would use any other simpler data type. Pass to an object to a method. Return an object from a method. Use an array of objects.

30
New cards

Some methods do not require a this reference.

A class method instead of an instance method.