摘要: ​Ordinaryclassesandmethodsworkwithspecifictypes: eitherprimitivesorclasstypes.Ifyouarewritingcodethatmightbeusedacrossmoretypes,thisrigiditycanbeoverconstraining.One way that object-oriented languages allow generalization is through polymorphism. You can write (for example) a method that takes a bas 阅读全文
posted @ 2014-04-07 21:58 wuhn 阅读(154) 评论(0) 推荐(0) 编辑