Skip to Content
Learn
Virtual Computer
Instantiation Nation

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!

Folder Icon

Take this course for free

Already have an account?