ЁЯУв Too many exams? DonтАЩt know which one suits you best? Book Your Free Expert ЁЯСЙ call Now!


    Question

    Which of the following is an example of parametric

    polymorphism?
    A Method overloading. Correct Answer Incorrect Answer
    B Method overriding. Correct Answer Incorrect Answer
    C Using generics (e.g., List in Java, std::vector in C++). Correct Answer Incorrect Answer
    D Implementing an interface. Correct Answer Incorrect Answer
    E Using abstract classes. Correct Answer Incorrect Answer

    Solution

    Parametric polymorphism allows a function or a data type to be written generically, to handle values identically without depending on their type. Generics (like List or templates in C++) are the primary mechanism for achieving parametric polymorphism, where T can be any type.

    Practice Next
    More IT Operating System Questions
    ask-question