Ref: Interview: Can we instantiate abstract class?


為什麼會說有問題呢?因為 abstract class 不能被 instantiate

You can't instantiate your abstract class, however you can instantiate a concrete subclass of your abstract class.

My my = my() {};   // 這樣是 anonymous implementation

My my = my();       // 這樣才是 instantiate 


comments powered by Disqus
Copyright © 2013 Andro Chen
Powered by Logdown and Greyshade
Favicon from The Noun Project