FlashKeepers

Computer Science · College · College and University

Object-Oriented Programming, Unit 4: Polymorphism

Object-Oriented Programming, unit: Polymorphism. Core concepts, terminology, and worked-example cues a college student meets for this unit, building on prior units without repeating them. Front: a term, concept, or short problem cue. Back: the definition, explanation, or answer.

About this set

38 basic cards for College Computer Science. Set 4 of 7 in Object-Oriented Programming. It opens with "What is polymorphism?" and "What is compile-time (static) polymorphism?". Study it alongside the other College sets below.

38 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is polymorphism?
Show answerThe ability of different object types to be treated through a common interface, with type-specific behavior
What is compile-time (static) polymorphism?
Show answerPolymorphism resolved during compilation, typically through method overloading
What is runtime (dynamic) polymorphism?
Show answerPolymorphism resolved during program execution, typically through method overriding
What is dynamic dispatch?
Show answerThe runtime process of determining which overridden method implementation to call
How does polymorphism improve code flexibility?
Show answerCode can work with objects of different types through a shared interface, without needing to know their specific type
What is an example of polymorphism using a shared superclass?
Show answerCalling a 'speak' method on different Animal subclasses, each producing different behavior
What is parametric polymorphism (generics)?
Show answerWriting code that works across multiple data types using type parameters
What is duck typing?
Show answerA style of polymorphism where an object's suitability is determined by its methods, not its declared type
What is the benefit of using polymorphism with collections?
Show answerA single collection can hold different subclass objects and be processed uniformly
What is an interface's role in enabling polymorphism?
Show answerDefining a common contract that multiple unrelated classes can implement differently
What is upcasting, in the context of polymorphism?
Show answerTreating a subclass object as an instance of its superclass or interface type
What is downcasting?
Show answerConverting a superclass or interface reference back into its specific subclass type
Why can downcasting be risky?
Show answerIt can fail at runtime if the object is not actually an instance of the target subclass
What is late binding?
Show answerDeferring the decision of which method implementation to run until runtime
What is subtype polymorphism?
Show answerThe ability to use a subclass object wherever its superclass or implemented interface type is expected.

23 more cards in the app

Study this set free