Try   HackMD

Interface Abstract 差異

tags: Design Pattern Interface Abstract

兩者差異

  • Abstract 較接近層次的抽象
  • Interface 行為、動作的抽象

兩者相同

  • 不能直接new來使用
  • 都是抽象層,包含抽象的方法,且不能直接生成instance

Interface 特點

  • 使用時機
    • 多個class

Abstract 特點