# Upcasting

*noun*

say it: **“UP-kast-ing”** **/ˈʌpkæstɪŋ/**

Treating an object as its base class type, which is always safe and happens automatically.

## What is **Upcasting**?

**Upcasting** is treating an object as its parent type. It is always safe, because a `Dog` *is* an `Animal`. It happens automatically.

```csharp
Dog rex = new Dog();
Animal pet = rex; // upcast
```

## In a sentence

- “Putting an Ebook in a List&lt;Book> is **upcasting**, and C# does it for you.”

Level: Journeyman · [More OOP terms at this level](https://www.ask-codey.com/glossary?category=oop&level=3)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/upcasting
