阅读背景:

是不是被认为是不好的做法?如果是这样,在什么情况下仍然更可取?

来源:互联网 

Over the years, I've tried to avoid instanceof whenever possible. Using polymorphism or the visitor pattern where applicable. I suppose it simply eases maintenance in some situations... Are there any other drawbacks that one should be aware of?




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

分享到: