新手问题 简单的程序错误,找不到

redhatping · July 13, 2013 · Last by redhatping replied at July 13, 2013 · 1888 hits

Class Square def initialize(side_length) @side_length = side_length end

def area @side_length * @side_length end end

a = Square.new(10) puts a.area

显示 D:/2013/RUBY/class/2.rb:10: syntax error, unexpected kEND, expecting $end [Finished]

什么原因呢?

class 小写。。。。找到了,哈哈

You need to Sign in before reply, if you don't have an account, please Sign up first.