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")
- In the example above, we first define a
Person
class with aninitialize
method. - Then, we create a new instance of
Person
and store it in a new variable calledemma
.
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
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.