Skip Top Navigation Bar

Mutable vs. Immutable Data and Strings

Overview

In this lesson, students will begin to develop an understanding of the different between data that is mutable (changeable) and immutable (unchangeable).

Learning Objectives

Skills

Student Outcomes

Students will be able to:

Duration: 0.5 class period

Resources

Warm-up / Motivation

Ask students to think about an app that they use regularly. You can ask them to use the app they used in the Determining a Data Type Lesson. Ask them: what data changes while you are using the app?

Learn

Either as a group or on their own, have students work through the tutorial on mutable and immutable data: Learn - Mutable vs Immutable Data

Some additional examples of mutable data:

Some additional examples of immutable data:

Practice

Wrap-up / Extensions

Ask students to revisit their app from earlier. Ask them: Is there data that should not change in the app?

Next Lesson

Lesson Plan: Creating Records