GoConqr has a new look! Let us know what you think.

Flashcards

Polymorphism

BLU BLU German 5 cards

Cards in this deck (5)

  1. 1What means Polymorphism literally?It means many forms
    - poly means many
    morph means form
  2. 2What is Polymorphism?It is a concept by which we can perform a single action in different ways
  3. 3Which types of Polymorphism is there?-Compile Time (Static)
    -> can be archived by Method Overloading or Constructor Overloading
    - Runtime (Dynamic)
    -> can be archived by Method Overriding
  4. 4How can Method Overloading or Constructor Overloading be archived?- By keeping the same method name and changing:
    -number of parameters
    -type of parameters
    - order of parameters
    Da der Compiler immer eine Methode basierend auf dem Kontext in der gleichen Klasse auswählt, ist Overloading nicht für Methoden in unterschiedlichen Klassen vorgesehen.
  5. 5How can Method Overriding be archived?Runtime Polymorphism
    Runtime (Dynamic)
    Method Overriding
    - Can be archieved in Inheritance by reimplementing the parent class method in Child class
    class: printer
    print() {
    Syso("Welcome);
    };
    class Greeter inherits from printer class
    @Overriden
    print(){
    Syso("HI");
    }

Information

Description
Flashcards on Polymorphism, created by BLU BLU on 13/01/2025.
Created by
BLU BLU
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?