Mutable Variables

In the following lesson, you will learn how to declare a mutable variable.

We'll cover the following

Mutable is defined as something that can be altered, and mutable variables are just that; variables whose values can be altered.

Declaring a Mutable Variable #

To declare a mutable variable, we use the var keyword. Let’s take the same example we used in the previous lesson. We have a variable message which is assigned a String value.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy