Learn

Excellent! Last step: let’s create an instance of our Computer class.

You’ve done this before, but here’s a refresher.

class Person def initialize(name) @name = name end end emma = Person.new("emma")
  1. In the example above, we first define a Person class with an initialize method.
  2. Then, we create a new instance of Person and store it in a new variable called emma.

Instructions

1.

After your class, create a new instance of Computer and store it in a new variable called my_computer. Feel free to use whatever username and password you like for your arguments!

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?