COMP 155: Object Oriented Programming Concepts

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

1/166

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:47 PM on 4/15/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

167 Terms

1
New cards

Inheritance

Class obtains variables and methods from another class.

2
New cards

Subclass

Derived class that specializes behavior of superclass.

<p>Derived class that specializes behavior of superclass.</p>
3
New cards

Superclass

Base class from which subclasses are derived.

<p>Base class from which subclasses are derived.</p>
4
New cards

Code Reuse

Using existing code to avoid duplication.

<p>Using existing code to avoid duplication.</p>
5
New cards

Class Hierarchy

Structure showing relationships between classes.

<p>Structure showing relationships between classes.</p>
6
New cards

Transitive Inheritance

Subclass instances are also superclass instances.

<p>Subclass instances are also superclass instances.</p>
7
New cards

extends keyword

Keyword used to inherit from another class.

<p>Keyword used to inherit from another class.</p>
8
New cards

Single Inheritance

One subclass extends one superclass.

<p>One subclass extends one superclass.</p>
9
New cards

Multi-level Inheritance

Subclass extends another subclass.

<p>Subclass extends another subclass.</p>
10
New cards

Hierarchical Inheritance

Multiple subclasses extend a single superclass.

<p>Multiple subclasses extend a single superclass.</p>
11
New cards

Object Class

Default class at the top of hierarchy.

<p>Default class at the top of hierarchy.</p>
12
New cards

Method Overriding

Subclass provides its own implementation of superclass method.

<p>Subclass provides its own implementation of superclass method.</p>
13
New cards

Access Modifiers

Control visibility of class members (e.g., private).

<p>Control visibility of class members (e.g., private).</p>
14
New cards

Instance

Object created from a class.

<p>Object created from a class.</p>
15
New cards

Polymorphism

Ability to treat objects of different classes uniformly.

16
New cards

Encapsulation

Bundling data and methods that operate on data.

17
New cards

Abstract Class

Class that cannot be instantiated, may contain abstract methods.

18
New cards

Interface

Contract that classes can implement, defining methods.

19
New cards

Method Signature

Combination of method name and parameter types.

20
New cards

Constructor

Special method called when an object is instantiated.

21
New cards

Overloading

Defining multiple methods with the same name but different parameters.

22
New cards

Aggregation

Relationship where one class contains references to another.

23
New cards

Visibility Modifiers

Determine accessibility of class members.

24
New cards

Public Modifier

Accessible from outside the class definition.

25
New cards

Private Modifier

Accessible only within the class definition.

26
New cards

Protected Modifier

Accessible in subclasses and same package.

27
New cards

Default Access

Accessible within the current Java package.

28
New cards

Encapsulation

Restricting access to class members.

29
New cards

Super Keyword

Refers to superclass members in subclass.

30
New cards

Constructor Call

Invokes superclass constructor from subclass.

31
New cards

Method Call

Calls superclass method to avoid redundancy.

32
New cards

Variable Hiding

Subclass variables hide superclass variables.

33
New cards

Class A Example

Defines variable 'i' initialized to 1.

34
New cards

Class B Example

Defines variable 'i' initialized to 2.

35
New cards

Show Method

Prints value of variable 'i' in subclass.

36
New cards

Inheritance

Subclassing allows access to superclass members.

37
New cards

Access Control

Regulates member visibility in Java.

38
New cards

Protected vs Public

Protected is less accessible than public.

39
New cards

Protected vs Private

Protected is more accessible than private.

40
New cards

Method Redundancy

Avoids duplicate code by using superclass methods.

41
New cards

Class Member

Variables and methods within a class.

42
New cards

Java Package

Namespace for organizing related classes.

43
New cards

Super

Keyword to access superclass members.

44
New cards

Hiding

Subclass variable obscures superclass variable.

45
New cards

Multi-Level Hierarchy

Inheritance structure with multiple levels of classes.

46
New cards

Box Class

Represents a 3D box with dimensions.

47
New cards

BoxWeight Class

Extends Box to include weight property.

48
New cards

Ship Class

Extends BoxWeight to include shipping cost.

49
New cards

Volume Method

Calculates volume of a box: width height depth.

50
New cards

Constructor

Special method to initialize class objects.

51
New cards

Superclass

Class from which properties are inherited.

52
New cards

Subclass

Class that inherits properties from superclass.

53
New cards

Method Overriding

Subclass method replaces superclass method with same signature.

54
New cards

super Keyword

Used to call superclass constructors or methods.

55
New cards

Child Class

Class that inherits from a parent class.

56
New cards

Parent Class

Class from which child classes derive.

57
New cards

Reference Type

Type of variable that determines which class methods can be called.

58
New cards

Object Creation

Instantiating a class to create an object.

59
New cards

Encapsulation

Hiding class attributes and methods from outside access.

60
New cards

Constructor Overloading

Multiple constructors with different parameters in a class.

61
New cards

Inheritance

Mechanism to acquire properties from another class.

62
New cards

Data Member

Variable defined in a class.

63
New cards

Access Modifier

Defines visibility of class members (e.g., private, public).

64
New cards

Polymorphism

Ability to process objects differently based on their data type.

65
New cards

Overridden Method

Method in sub-class that replaces super-class method.

66
New cards

Sub-class Method

Method that overrides a super-class method.

67
New cards

Super-class Method

Original method hidden by sub-class method.

68
New cards

Hiding

Sub-class method conceals super-class method.

69
New cards

Overriding

Same method name in parent and child classes.

70
New cards

Method Signature

Method name and parameter types combined.

71
New cards

Polymorphism

Objects of different classes respond to same method.

72
New cards

Dynamic Binding

Method call resolved at runtime based on object type.

73
New cards

Polymorphic Reference

Reference that can point to different object types.

74
New cards

Overloading

Multiple methods with same name, different signatures.

75
New cards

Common Interface

Defined by super-class for sub-classes to implement.

76
New cards

Specialized Behavior

Sub-class implementation of inherited method.

77
New cards

Driver Class

Class containing main method to execute code.

78
New cards

Output of show()

Displays value of k from sub-class B.

79
New cards

Constructor

Method to initialize object attributes.

80
New cards

Inheritance

Mechanism where sub-class inherits properties of super-class.

81
New cards

Object Type

Class type of an instantiated object.

82
New cards

Method Invocation

Calling a method on an object.

83
New cards

Java Reference

Variable that holds the address of an object.

84
New cards

Polymorphic References

References resolved at run-time, not compile-time.

85
New cards

Dynamic Binding

Method invocation determined at run-time.

86
New cards

Dynamic Method Dispatch

Runtime selection of method based on object type.

87
New cards

Animal Class

Base class for animal sound methods.

88
New cards

Pig Class

Subclass of Animal that overrides animalSound.

89
New cards

Dog Class

Subclass of Animal that overrides animalSound.

90
New cards

makeSound() Method

Calls animalSound() based on Animal object.

91
New cards

Superclass Constructor

Called before subclass constructor executes.

92
New cards

Constructor Call Order

Superclass constructors execute before subclass constructors.

93
New cards

Implicit Constructor Call

Default constructor called if no explicit call is made.

94
New cards

Explicit Constructor Call

Use super() to call parameterized superclass constructor.

95
New cards

Base Class Object

All Java classes inherit from Object class.

96
New cards

Object Class Methods

Includes equals(), getClass(), hashCode(), toString().

97
New cards

instanceof Operator

Tests if an object is of a specific type.

98
New cards

Type Comparison Operator

Compares instance type with specified type.

99
New cards

Overriding Methods

Subclass provides specific implementation of superclass method.

100
New cards

Elegant Software Design

Achieved through careful use of polymorphic references.