软件设计模式课件 Lect0-Java Important Concepts.pptVIP

  • 2
  • 0
  • 约1.08万字
  • 约 41页
  • 2020-11-10 发布于四川
  • 举报

软件设计模式课件 Lect0-Java Important Concepts.ppt

Why use interface? 重复利用 For reuse purpose, an interface can define a set of related functions for some special use 声明类型 An interface can be used to claim a type, with its different subclasses to implement its functions. The purpose is to realize dynamic binding 代表某个协议 A language environment may need a protocol to do something special and so need an interface, e.g., java interface Runnable must be implemented whenever a programmer wants to write a multithread program Java Interface(Java接口) Code for dynamic binding: Account act if(usrChoice == 1) act = new CheckingAccount (); else if(usrC

文档评论(0)

1亿VIP精品文档

相关文档