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

redhatping · 2013年07月13日 · 最后由 redhatping 回复于 2013年07月13日 · 1887 次阅读

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 小写。。。。找到了,哈哈

需要 登录 后方可回复, 如果你还没有账号请 注册新账号