fork download
  1. class C
  2. def initialize(v)
  3. @value = v
  4. end
  5. def show()
  6. p @value
  7. end
  8. def getValue()
  9. return @value
  10. end
  11. def setValue(v)
  12. @value = v
  13. end
  14. end
  15. c1 = C.new(10)
  16. # p c1.value
  17. p c1.getValue()
  18. # c1.value = 20
  19. c1.setValue(20)
  20. p c1.getValue()
Success #stdin #stdout 0.01s 7456KB
stdin
Standard input is empty
stdout
10
20