M9 Flashcards on Type Casting and Polymorphism

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

1/15

flashcard set

Earn XP

Description and Tags

Flashcards to review key concepts related to type casting, polymorphism, and inner classes in Java.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

16 Terms

1
New cards

Type Casting

The process of converting a variable from one data type to another.

2
New cards

Two Main data types

Primitive data types and User-defined data types

3
New cards

Widening Type Casting

Implicit type casting, done by the compiler, which widens or upcasts a smaller type to a larger type (e.g., int to double).

4
New cards

Narrowing Type Casting

Explicit type casting, done manually by the user, which narrows or downcasts a larger type to a smaller type (e.g., double to int).

5
New cards

Data Loss

May lead to data loss, particularly in narrowing type casting.

6
New cards

Class Type Casting

Requires an 'Is-a' relationship between classes.

7
New cards

Static Binding (Early Binding)

Performed at compilation time; involves static, private, and final methods; uses overloaded methods.

8
New cards

Dynamic Binding (Late Binding)

Performed at execution time; involves overridden methods.

9
New cards

Class Type Upcasting

A parent class object referring to its child class object.

10
New cards

Class Type Downcasting

A child class object referring to its parent class object, which may require explicit downcasting.

11
New cards

Inner Classes

Classes defined inside another class, used for grouping related classes, improving code readability and maintainability, and supporting encapsulation.

12
New cards

Regular Inner Class

Cannot be directly accessed from outside the outer class without creating an instance of the outer class first.

13
New cards

Private Inner Class

Cannot be accessed from outside the class

14
New cards

Static Inner Classes

Can be accessed without creating an object of the outer class.

15
New cards

M.I.C.E.

Messages, Inheritance, Class, Encapsulation

16
New cards

R.P.I.G.S.

Relationships, Polymorphism, Information Hiding, Generics, State Retention