fork download
  1. class Class1
  2. def method1()
  3. return 'm1'
  4. end
  5. end
  6. c1 = Class1.new()
  7. p c1, c1.method1()
  8.  
  9. class Class3 < Class1
  10. def method2()
  11. return 'm2'
  12. end
  13. end
  14. c3 = Class3.new()
  15. p c3, c3.method1()
  16. p c3, c3.method2()
  17.  
Success #stdin #stdout 0.02s 7412KB
stdin
Standard input is empty
stdout
#<Class1:0x9931724>
"m1"
#<Class3:0x9931670>
"m1"
#<Class3:0x9931670>
"m2"