Question:
module A
class B
def say_hi
"Hi"
end
end
end
module A
class C
def say
b1 = A::B.new
p b1.say_hi # Hi
b2 = B.new
p b2.say_hi # Hi
end
end
end
c = A::C.new
c.say
如上示例:
其中在 module A 中A::B.new
和B.new
区别是什么?