Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as Ruby by xxx ( 12 years ago )
require 'pp'

class X
  def initialize(a)
    @a = a
  end
end

class Y < X
  def initialize(a)
    super
    @b = 5
  end
end

class Z
  def initialize(a,b)
    @a = a
    @b = b
  end
end

pp Y.new(3)
pp Z.new(3,5)

 

Revise this Paste

Your Name: Code Language: