开发者

how to define a class in only one line?

I tried

class X begin end

and

开发者_JAVA百科
class X {}

neight correct. What is the right code?


You need a semicolon after class X:

class X; end


correct and verified example:

class C; end

and another, tricky solution :)

C = Class.new
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜