CHAPTER 11 - Polymorphism

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

1/17

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.

18 Terms

1
New cards

Polymorphism

is a concept in object-oriented programming that allows objects of different classes to be used interchangeably, while still maintaining their own unique behavior. This means that objects of different classes can respond to the same message or method in different ways.

2
New cards

Polymorphism

allows to use a single interface to represent different objects that share a common behavior.

3
New cards

Poly

means "many"

4
New cards

Morph

means "Take different forms"

5
New cards

Static, dynamic

two types of polymorphism

6
New cards

Static

______ polymorphism, also known as compile time polymorphism, refers to the ability of the compiler to determine which method to call at compile time based on the arguments passed to the method.

7
New cards

Static

______ polymorphism is achieved through method overloading, where multiple methods in the same class have the same name but different parameters.

8
New cards

Dynamic

_______ polymorphism is achieved through method overriding, where a subclass provides a different implementation of a method that is already defined in its superclass.

9
New cards

Dynamic

_______ polymorphism, also known as runtime polymorphism, refers to the ability of objects to respond to the same message with the appropriate method based on their class definition at runtime.

10
New cards

Static, dynamic

method overloading, constructor overloading, and method hiding is to ______ polymorphism, as method overriding is to _______ polymorphism

11
New cards

Binding

refers to the process of associating a method or function call with its implementation at runtime.

12
New cards

Binding

The connecting (linking) between a method call and method body/definition

13
New cards

Static, dynamic

There are two types of binding in Java: ______ binding and _______ binding

14
New cards

Static binding

Occurs when the method to be called is determined at compile time. This happens when the method being called is a static method, private method, final method or a constructor.

15
New cards

Static binding

The compiler can determine which method to call based on the method signature and the static type of the object on which the method is being called.

16
New cards

Static binding

This binding is also known as early binding because it takes place before the program actually runs. An example of it is method overloading

17
New cards

Dynamic binding

Also known as late binding or runtime binding, occurs when the method to be called is determined at runtime. This happens when the method being called is a non-static method and the actual type of the object on which the method is being called is not known until runtime.

18
New cards

Dynamic binding

is also called late binding or runtime binding because binding occurs during runtime. An example of it is method overriding.