What is wrong with my code?


#1

class Circle
def initalize(radius)
@radius=radius
end

def putting
return @radius**2
end
end

a = Circle.new(3)

puts a.putting

I want it to print out ----> 9

THIS IS THE ERROR!!!

wrong number of arguments (1 for 0)(Argument)

puts a.putting


#2

Please help us by posting a link to the exercise. Thanks.


#3

my mistake was not to put initialize when i was defining my method under class.

i wrote initalize instead of initialize


#4

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