1/11
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
Polymorphism
What allows performing of a single action in a different ways?
(1) Static
(2) Dynamic
What are the types of polymorphism?
(1) […]
(2) […]
Static Polymorphism
Flow of control is decided during compile time.
Static Polymorphism
It is achieved through method overloading.
Dynamic Polymorphism
Flow of control is decided during runtime.
Dynamic Polymorphism
It is achieved through method overriding.
casting
You can change the existing type of an object reference to another type through […].
(1) Upcasting
(2) Downcasting
Types of Object Casting:
(1) […]
(2) […]
Upcasting
What is casting from a subclass to a superclass?
Downcasting
What is casting from a superclass to a subclass?
exception
runtime
instance
Rules in casting objects:
(1) The compiler will not allow casts to […].
(2) Even when the code compiles without issue, an […] may be thrown at […] if the object being cast is not actually an […] of that class.
(1) same signature
(2) as accessible or more accessible
(3) new or broader
Rules in Overriding Methods:
(1) The method in the child class must have the […] as the method in the parent class.
(2) The method in the child class must be at least […] or […] than the method in the parent class.
(3) The method in the child class may not throw a checked exception that is […] or […] than the class of any exception thrown in the parent class method.