Z
Zhao Yi
Please see this code below. It will get "can't convert nil to string
error". Why can't the @name be assigned? I have set the @name = "world".
class Hello
@name="world"
def say
puts "Hello "+@name
end
end
h=Hello.new
h.say
error". Why can't the @name be assigned? I have set the @name = "world".
class Hello
@name="world"
def say
puts "Hello "+@name
end
end
h=Hello.new
h.say