# Upcasting

Treating an object as its parent type; always safe and automatic.

## 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
```

Level: Journeyman · [More OOP terms at this level](https://www.ask-codey.com/glossary/subjects/oop/journeyman)

Updated: September 27, 2026

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