Everything About ___
Live briefing

Everything about Downcasting

Act of casting a reference of a base class to one of its derived classes

In class-based programming, downcasting, or type refinement, is the act of casting a base or parent class reference, to a more restricted derived class reference. This is only allowable if the object is already an instance of the derived class, and so this conversion is inherently fallible. In contrast upcasting, explicitly treating an object as if it's an instance of one of its superclasses, is always possible. Wikipedia →

đź§­ Start here: a 6-step reading path

  1. Read the overview: DowncastingA 5-minute orientation
  2. Pick up a classic book: Novels (Sign of Four / Study in Scarlet)The most-reprinted book on the subject
  3. Read the landmark paper: Multiple downcasting techniquesCited 1 times
  4. Go sideways: Any typeA closely related topic
  5. Go sideways: Generics in JavaA closely related topic

đź“– Definitions

Verb present participle and gerund of downcast

🗂️ The subject at a glance

  1. Examples
  2. Uses
  3. Considerations

🏆 Landmark papers (most cited)

📚 Books worth reading

Ranked by number of editions on Open Library, a rough measure of how lasting a book is.

đź”— Related topics