Defining a Basic Class, With an Instance Method

The goal for this exercise is to understand how to create your own, simple class, with an instance method (function).

What you need to do to prepare for this exercise:


What you need to do for this exercise
  1. Within the provided starter project, there is already a class named Basic_Class_With_Instance_Method. You should create a class named Toaster below it, in the space indicated.

    1. Within the Toaster class, you should define a method named Print(), which takes no parameters, and returns no data. When called, Print() will (for now) print out the message Hello, World, from the Instance Method Exercise!

  2. Within Basic_Class_With_Instance_Method.RunExercise, you should create a new instance of the Toaster class, and call Print, which will print out the message.

  3. FYI – the following phrases are all (conceptually) identical:

    • An instance of the Toaster class

    • An object of the Toaster class

    • An object of type Toaster

    • A Toaster object