# Changing Roles

Polymorphism means focusing on just the one role of an object that matters at the moment, as Chloe is a student, a musician and an athlete at different times of day.

Journeyman · Java · OOP · Updated November 16, 2026

By Gregor Dzierzon

Throughout each day Chloe goes from being in class, to rehearsing with the drama club, and finally finishes the day with an intense volleyball practice.

## Student

![Chloe studying math: her role as a student](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/8378c8f669314f288a4c0938d1462f82.png)

In class, Chloe's teacher treats her like a student. She is expected to study, and to take tests.

## Musician

![Chloe singing on stage: her role as a musician](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/630e568350cc4e8e9afc2b7d5e79dd0b.png)

During play rehearsal, she is expected to know her parts, to sing and to remember her spoken lines.

## Athlete

![Chloe playing volleyball: her role as an athlete](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/b3f3b07edb62480782f26667669f0a42.png)

At volleyball, Chloe's teammates depend on her to be at her best athletically. She needs to serve well and be a powerful outside hitter.

Chloe is smart, musically talented, and athletic, but the focus of what she is doing changes throughout the day.

When her teacher asks her to take a test, she is treating her like a student. This does not change the fact that Chloe still has the ability to sing, or to play volleyball, but the teacher is only focused on her abilities as a student at that time.

This is the essence of polymorphism. Through polymorphism we focus only on those things that matter to our code at that moment, and we ignore the rest.

When we say that an object can take on many forms, we don't mean that the object is actually shapeshifting, we mean that we are shifting our focus to only one of the "shapes" (or abilities) of an object.

## Cheat sheets

- [What is Polymorphism? Changing Roles](https://www.ask-codey.com/cheat-sheets/what-is-polymorphism-an-overview-cheat-sheet)

Source: https://www.ask-codey.com/lessons/what-is-polymorphism-changing-roles
