#2 I don't even


#1

I have no idea what I'm doing wrong, can someone help me ?


class Dog
    Dog initialize(name, breed)
       @name = Jessie
       @breed = Mutt
  end
end


#2

Hello.
Try to change "Dog initialize" to "def initialize".
I tried yours, but didnt work, but just changing that part work fine.
Example:

class Dog
    def initialize(name, breed)
       @name = Tsuki
       @breed = Wolf
  end
end

#3

Assign the constructor parameters:

@name = name
@breed = breed

Then supply the literals when invoking an instance.

jessie = Dog.new("Jessie", "mutt")

#4

Thank you very much. ^^


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.