#!/usr/local/bin/ruby i = 100 @i = 555 class C i = 333 def set_i(value) @i = value end def get_i() return @i end end class D i = 999 def set_i(value) @i = value end def get_i() return @i end end @i = 555 c = C.new() c.set_i("ok") p(c.get_i()) # "ok"を表示する p i p @i