Undefined Variables of a Class Type

In this lesson, we will look at what happens when you forget to initialize your variables.

Two instances of the class Square

Let’s create two Square objects using the class Square given in the previous chapter. The following program attempts this task but includes a common mistake that anyone might make. Do you see the mistake?

Get hands-on with 1200+ tech skills courses.