阅读背景:

一种将基类型转换为派生类型的方法

来源:互联网 

I'm not sure if this is a strange thing to do or not, or if it is some how code smell...but I was wondering if there was a way (some sort of oop pattern would be nice) to "cast" a base type to a form of its derived type. I know this makes little sense as the derived type will have additional functionality that the parent doesn't offer which is in its self not fundamentally sound. But is there some way to do this? Here is a code example to so I can better explain what I"m asking.I'm not sure if this is a strange thing to do o




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: