1/99
Flashcards covering key definitions, concepts, and characteristics of Object-Oriented Programming (OOP), objects, classes, abstraction, encapsulation, inheritance, and polymorphism.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Object
A thing that can be tangible or intangible, possessing attributes and behavior.
Tangible Object
An object that we can see and touch, such as people or vehicles.
Intangible Object
An object that we cannot see and touch, such as laws, policies, events, or accounts.
Examples of Tangible Objects
People (student, staff, employee) and vehicles (car, bike).
Examples of Intangible Objects
Laws, policies, events, and accounts.
Elements of an Object
Attribute, behaviour, and identity.
Attribute
The relevant data that relates to an object; also referred to as a state, field, or variable.
Alternative Terms for Attribute
State, field, variable, data member, or property.
State
The description about the data (fields/attributes) contained in an object at any point in time.
State Change
The change that occurs to an object's state when its underlying attribute data changes.
Behaviour
The ability of an object to perform actions and have actions performed on it; also known as methods or functions.
Alternative Terms for Behaviour
Methods, functions, actions, or operations.
Identity
An intrinsic element of an object that distinguishes it as a unique entity apart from its attribute and behaviour.
Object in OOP
A collection of fields (object state, data members, instance variables) and methods (behaviors).
Fields (in OOP)
The variables representing an object's state, data members, or instance variables.
Methods (in OOP)
The operations or functions that represent an object's behaviors and manipulate its data.
Bicycle State Example
Current gear, current pedal cadence, and current speed.
Bicycle Behavior Example
Changing gear, changing pedal cadence, and applying brakes.
Car Attributes Example
Color and model.
Car Behaviour Example
Moving, changing gear, and stopping.
Car States Example
State 1: blue, toyota; State 2: red, honda.
Air-Conditioner State Example
Turn on, and current temperature is 24 degrees Celsius.
Air-Conditioner Behaviour Example
Change the temperature level.
Siamese Cat State Example
Dark brown colours on its face, ears, and feet.
Siamese Cat Behaviors Example
Playing, fighting, and hunting.
Object Differentiation
What makes individual objects of the same general type distinct from one another: their specific states and behaviors.
Class
A template or abstraction of a real-world entity that specifies the attributes and behaviors for a collection of objects of similar type.
Class as an Abstraction
A template serving as an abstraction of a real-world entity to specify object attributes and behaviors.
Class Specifications
The formal definitions provided by a class that outline the attributes and behaviors of its objects.
Class Collection
A group or collection of objects of similar type.
Class Definition Prerequisite
A class must be defined before creating an instance of the class.
Instance
An object created from a class.
Object Composition
Comprised of data (attributes) and methods (operations) that manipulate these data.
Object Instantiation Cardinality
A program can create one object or many objects from a single class.
Variables (Class Diagram)
Represent the data/attributes variables and define a set of properties for a class.
Methods (Class Diagram)
Represent behaviors; a sequence of instructions that a class or object follows to perform a task.

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".
Student Class Variables
name and id.
Student Class Methods
setName(), setId(), and updName().
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.
Cat Common Characteristics (Data Members)
Breed, size, age, and color.
Cat Common Actions (Methods)
Eat, sleep, sit, and run.
Neapolitan Mastiff Cat Object
A cat object instance with Breed = Neapolitan Mastiff, Size = Large, Age = 5 years, and Color = Black.
Maltese Cat Object
A cat object instance with Breed = Maltese, Size = Small, Age = 2 years, and Color = White.
Chow Chow Cat Object
A cat object instance with Breed = Chow Chow, Size = Midium, Age = 3 years, and Color = Brown.
Java Class Declaration for Cat
public class Cat { String breed; String size; int age; String color; … }
Cat Instance Variables
String breed; String size; int age; String color;
getInfo() Method (Cat Example)
A method returning: ("Breed is: "+breed+" Size is:"+size+" Age is:"+age+" color is: "+color).
new Operator (Java)
The operator used to create an instance of a class in Java (e.g., new Cat()).
Cat Object Creation Statement
Cat maltese = new Cat();
Output of Cat Class Code Example
Breed is: Maltese Size is: Small Age is: 2 color is: white
Software Development Challenge: Maintainability
Software is difficult to develop, maintain, and modify.
Software Development Challenge: Delivery & Budget
Most software projects go over budget and are delivered late.
Software Development Challenge: Ground-Up Creation
Programmers having to create software entirely from the ground-up.
Purpose of OOP Techniques
Developing more cost-effective and efficient software that is delivered on time, while adapting quickly to changes or client demands.
Software Adaptability
The ability introduced by OOP to adapt quickly to new changes or client demands.
Four Characteristics of OOP
Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction
The act of a software module containing relevant characteristics of the object to be represented (designing classes).
Basis of Object Modeling in Abstraction
Based on data that can be stored and functions which manipulate that data.
Object Type Declaration via Class
The abstraction mechanism wherein types of objects are declared in a program through a class.
Hierarchical Classifications in Abstraction
The principle that different programmers may model the same object from different class hierarchical classifications.
Encapsulation (Literal Meaning)
To enclose in a capsule; a way of packaging information.
Encapsulation (OOP Definition)
The practice of packaging data (attributes) and methods (behavior) together into a single container called a class.
Container of Encapsulation
Classes, which bundle data and methods into a single unit.
Data Hiding
Declaring object data to be private so it will not be accessible by non-member modules.
private Access Modifier Role
Used in classes to implement data hiding by restricting direct data access from non-member modules.
Interface Communication in Encapsulation
Objects communicate with one another through interfaces without being allowed to know how other objects are implemented.
Implementation Hiding
Preventing external objects from knowing internal implementation details while still allowing communication via an interface.
Inheritance
The process by which one object acquires the properties of another object, implemented in Java using extends.
extends Keyword
The Java keyword used to implement inheritance between a subclass and a superclass.
Subclass Specialization Principle
An object need only define qualities that make it unique within its class, inheriting general attributes from its parent.
Subclass Defining Requirement
A subclass must have at least one attribute or method that differs from its superclass.
Superclass
The parent class or base class from which a subclass inherits general properties.
Subclass
The child class or derived class that inherits general properties from a superclass and adds unique attributes/methods.
Base Class and Derived Class
Alternative terms for superclass and subclass.
Parent Class and Child Class
Alternative terms for superclass and subclass.
Is-a Relationship (is-a link)
The relationship formed by inheritance where a subclass is a specialized type of its superclass.

MobilePhone Inheritance Diagram
An inheritance hierarchy diagram showing MobilePhone as the superclass with CameraPhone and PdaPhone as subclasses.
CameraPhone Subclass
A subclass of MobilePhone that inherits model, manufacturer, and price, and adds the pixel attribute.
PdaPhone Subclass
A subclass of MobilePhone that inherits model, manufacturer, and price, and adds the memoryCap attribute.
pixel Attribute
The specific attribute defined in the CameraPhone subclass to differentiate it from MobilePhone.
memoryCap Attribute
The specific attribute defined in the PdaPhone subclass to differentiate it from MobilePhone.
MobilePhone Superclass Attributes
model, manufacturer, and price.

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.
Graduate Class (Hierarchy Example)
A direct subclass of Student that serves as a superclass to Masters and Doctoral.
Undergraduate Class (Hierarchy Example)
A direct subclass of Student that serves as a superclass to NonResident and Resident.
Masters and Doctoral Classes
Subclasses that inherit properties from the Graduate class and Student class.
NonResident and Resident Classes
Subclasses that inherit properties from the Undergraduate class and Student class.
Polymorphism (Etymology)
Derived from 'Poly' meaning many, and 'Morphism' meaning forms.
Polymorphism (OOP Definition)
A feature that enables classes to provide different implementations of methods having the same name.
One Interface, Multiple Methods
The guiding principle of polymorphism that allows one interface to represent a general class of actions.
General Class of Actions Interface
A single common interface used across multiple implementations to handle related actions in polymorphism.
Overloaded Methods
A few methods within a class that share the same name but have different parameters, illustrating polymorphism.
Rectangle Class Example Variables
length, width, and height.
displayShape(char simbol)
An overloaded method in the Rectangle class that takes a char parameter named simbol.
displayShape(int a)
An overloaded method in the Rectangle class that takes an int parameter named a.
Method (Quiz Definition)
An operation which can modify an object behavior.
Encapsulation (Quiz Definition)
The feature where an object combines data and operations on the data in a single unit.
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).
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.