CSC435 Topic 1: Introduction to Object Oriented Programming

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/99

flashcard set

Earn XP

Description and Tags

Flashcards covering key definitions, concepts, and characteristics of Object-Oriented Programming (OOP), objects, classes, abstraction, encapsulation, inheritance, and polymorphism.

Last updated 7:21 PM on 10/11/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

100 Terms

1
New cards

Object

A thing that can be tangible or intangible, possessing attributes and behavior.

2
New cards

Tangible Object

An object that we can see and touch, such as people or vehicles.

3
New cards

Intangible Object

An object that we cannot see and touch, such as laws, policies, events, or accounts.

4
New cards

Examples of Tangible Objects

People (student, staff, employee) and vehicles (car, bike).

5
New cards

Examples of Intangible Objects

Laws, policies, events, and accounts.

6
New cards

Elements of an Object

Attribute, behaviour, and identity.

7
New cards

Attribute

The relevant data that relates to an object; also referred to as a state, field, or variable.

8
New cards

Alternative Terms for Attribute

State, field, variable, data member, or property.

9
New cards

State

The description about the data (fields/attributes) contained in an object at any point in time.

10
New cards

State Change

The change that occurs to an object's state when its underlying attribute data changes.

11
New cards

Behaviour

The ability of an object to perform actions and have actions performed on it; also known as methods or functions.

12
New cards

Alternative Terms for Behaviour

Methods, functions, actions, or operations.

13
New cards

Identity

An intrinsic element of an object that distinguishes it as a unique entity apart from its attribute and behaviour.

14
New cards

Object in OOP

A collection of fields (object state, data members, instance variables) and methods (behaviors).

15
New cards

Fields (in OOP)

The variables representing an object's state, data members, or instance variables.

16
New cards

Methods (in OOP)

The operations or functions that represent an object's behaviors and manipulate its data.

17
New cards

Bicycle State Example

Current gear, current pedal cadence, and current speed.

18
New cards

Bicycle Behavior Example

Changing gear, changing pedal cadence, and applying brakes.

19
New cards

Car Attributes Example

Color and model.

20
New cards

Car Behaviour Example

Moving, changing gear, and stopping.

21
New cards

Car States Example

State 1: blue, toyota; State 2: red, honda.

22
New cards

Air-Conditioner State Example

Turn on, and current temperature is 24 degrees Celsius.

23
New cards

Air-Conditioner Behaviour Example

Change the temperature level.

24
New cards

Siamese Cat State Example

Dark brown colours on its face, ears, and feet.

25
New cards

Siamese Cat Behaviors Example

Playing, fighting, and hunting.

26
New cards

Object Differentiation

What makes individual objects of the same general type distinct from one another: their specific states and behaviors.

27
New cards

Class

A template or abstraction of a real-world entity that specifies the attributes and behaviors for a collection of objects of similar type.

28
New cards

Class as an Abstraction

A template serving as an abstraction of a real-world entity to specify object attributes and behaviors.

29
New cards

Class Specifications

The formal definitions provided by a class that outline the attributes and behaviors of its objects.

30
New cards

Class Collection

A group or collection of objects of similar type.

31
New cards

Class Definition Prerequisite

A class must be defined before creating an instance of the class.

32
New cards

Instance

An object created from a class.

33
New cards

Object Composition

Comprised of data (attributes) and methods (operations) that manipulate these data.

34
New cards

Object Instantiation Cardinality

A program can create one object or many objects from a single class.

35
New cards

Variables (Class Diagram)

Represent the data/attributes variables and define a set of properties for a class.

36
New cards

Methods (Class Diagram)

Represent behaviors; a sequence of instructions that a class or object follows to perform a task.

37
New cards
<p>Student Class Diagram Example</p>

Student Class Diagram Example

A class named Student defining variables (name, id) and methods (setName(), setId(), updName()), instantiated as :Student with name="Kamal" and id="1234".

38
New cards

Student Class Variables

name and id.

39
New cards

Student Class Methods

setName(), setId(), and updName().

40
New cards

Real-Life to Software Object Modeling

The process of identifying real-life entities (e.g., cats in a pet management system) and mapping their characteristics to data members and actions to methods.

41
New cards

Cat Common Characteristics (Data Members)

Breed, size, age, and color.

42
New cards

Cat Common Actions (Methods)

Eat, sleep, sit, and run.

43
New cards

Neapolitan Mastiff Cat Object

A cat object instance with Breed = Neapolitan Mastiff, Size = Large, Age = 5 years, and Color = Black.

44
New cards

Maltese Cat Object

A cat object instance with Breed = Maltese, Size = Small, Age = 2 years, and Color = White.

45
New cards

Chow Chow Cat Object

A cat object instance with Breed = Chow Chow, Size = Midium, Age = 3 years, and Color = Brown.

46
New cards

Java Class Declaration for Cat

public class Cat { String breed; String size; int age; String color; … }

47
New cards

Cat Instance Variables

String breed; String size; int age; String color;

48
New cards

getInfo() Method (Cat Example)

A method returning: ("Breed is: "+breed+" Size is:"+size+" Age is:"+age+" color is: "+color).

49
New cards

new Operator (Java)

The operator used to create an instance of a class in Java (e.g., new Cat()).

50
New cards

Cat Object Creation Statement

Cat maltese = new Cat();

51
New cards

Output of Cat Class Code Example

Breed is: Maltese Size is: Small Age is: 2 color is: white

52
New cards

Software Development Challenge: Maintainability

Software is difficult to develop, maintain, and modify.

53
New cards

Software Development Challenge: Delivery & Budget

Most software projects go over budget and are delivered late.

54
New cards

Software Development Challenge: Ground-Up Creation

Programmers having to create software entirely from the ground-up.

55
New cards

Purpose of OOP Techniques

Developing more cost-effective and efficient software that is delivered on time, while adapting quickly to changes or client demands.

56
New cards

Software Adaptability

The ability introduced by OOP to adapt quickly to new changes or client demands.

57
New cards

Four Characteristics of OOP

Abstraction, Encapsulation, Inheritance, and Polymorphism.

58
New cards

Abstraction

The act of a software module containing relevant characteristics of the object to be represented (designing classes).

59
New cards

Basis of Object Modeling in Abstraction

Based on data that can be stored and functions which manipulate that data.

60
New cards

Object Type Declaration via Class

The abstraction mechanism wherein types of objects are declared in a program through a class.

61
New cards

Hierarchical Classifications in Abstraction

The principle that different programmers may model the same object from different class hierarchical classifications.

62
New cards

Encapsulation (Literal Meaning)

To enclose in a capsule; a way of packaging information.

63
New cards

Encapsulation (OOP Definition)

The practice of packaging data (attributes) and methods (behavior) together into a single container called a class.

64
New cards

Container of Encapsulation

Classes, which bundle data and methods into a single unit.

65
New cards

Data Hiding

Declaring object data to be private so it will not be accessible by non-member modules.

66
New cards

private Access Modifier Role

Used in classes to implement data hiding by restricting direct data access from non-member modules.

67
New cards

Interface Communication in Encapsulation

Objects communicate with one another through interfaces without being allowed to know how other objects are implemented.

68
New cards

Implementation Hiding

Preventing external objects from knowing internal implementation details while still allowing communication via an interface.

69
New cards

Inheritance

The process by which one object acquires the properties of another object, implemented in Java using extends.

70
New cards

extends Keyword

The Java keyword used to implement inheritance between a subclass and a superclass.

71
New cards

Subclass Specialization Principle

An object need only define qualities that make it unique within its class, inheriting general attributes from its parent.

72
New cards

Subclass Defining Requirement

A subclass must have at least one attribute or method that differs from its superclass.

73
New cards

Superclass

The parent class or base class from which a subclass inherits general properties.

74
New cards

Subclass

The child class or derived class that inherits general properties from a superclass and adds unique attributes/methods.

75
New cards

Base Class and Derived Class

Alternative terms for superclass and subclass.

76
New cards

Parent Class and Child Class

Alternative terms for superclass and subclass.

77
New cards

Is-a Relationship (is-a link)

The relationship formed by inheritance where a subclass is a specialized type of its superclass.

78
New cards
<p>MobilePhone Inheritance Diagram</p>

MobilePhone Inheritance Diagram

An inheritance hierarchy diagram showing MobilePhone as the superclass with CameraPhone and PdaPhone as subclasses.

79
New cards

CameraPhone Subclass

A subclass of MobilePhone that inherits model, manufacturer, and price, and adds the pixel attribute.

80
New cards

PdaPhone Subclass

A subclass of MobilePhone that inherits model, manufacturer, and price, and adds the memoryCap attribute.

81
New cards

pixel Attribute

The specific attribute defined in the CameraPhone subclass to differentiate it from MobilePhone.

82
New cards

memoryCap Attribute

The specific attribute defined in the PdaPhone subclass to differentiate it from MobilePhone.

83
New cards

MobilePhone Superclass Attributes

model, manufacturer, and price.

84
New cards
<p>Student Inheritance Hierarchy Diagram</p>

Student Inheritance Hierarchy Diagram

A hierarchy diagram showing Student branching into Graduate and Undergraduate, with Graduate branching into Masters and Doctoral, and Undergraduate branching into NonResident and Resident.

85
New cards

Graduate Class (Hierarchy Example)

A direct subclass of Student that serves as a superclass to Masters and Doctoral.

86
New cards

Undergraduate Class (Hierarchy Example)

A direct subclass of Student that serves as a superclass to NonResident and Resident.

87
New cards

Masters and Doctoral Classes

Subclasses that inherit properties from the Graduate class and Student class.

88
New cards

NonResident and Resident Classes

Subclasses that inherit properties from the Undergraduate class and Student class.

89
New cards

Polymorphism (Etymology)

Derived from 'Poly' meaning many, and 'Morphism' meaning forms.

90
New cards

Polymorphism (OOP Definition)

A feature that enables classes to provide different implementations of methods having the same name.

91
New cards

One Interface, Multiple Methods

The guiding principle of polymorphism that allows one interface to represent a general class of actions.

92
New cards

General Class of Actions Interface

A single common interface used across multiple implementations to handle related actions in polymorphism.

93
New cards

Overloaded Methods

A few methods within a class that share the same name but have different parameters, illustrating polymorphism.

94
New cards

Rectangle Class Example Variables

length, width, and height.

95
New cards

displayShape(char simbol)

An overloaded method in the Rectangle class that takes a char parameter named simbol.

96
New cards

displayShape(int a)

An overloaded method in the Rectangle class that takes an int parameter named a.

97
New cards

Method (Quiz Definition)

An operation which can modify an object behavior.

98
New cards

Encapsulation (Quiz Definition)

The feature where an object combines data and operations on the data in a single unit.

99
New cards

False Statement on Java Objects

The claim that 'The behaviors of an object is defined by a set of data fields.' (Behaviors are defined by methods, not data fields).

100
New cards

Grocery Store Product Scenario Modeling

Modeling stock in a grocery store where the appropriate class is Product and its attributes are product number and product name.