`
zgqynx
  • 浏览: 1341071 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

thinking in java 读书笔记

    博客分类:
  • java
阅读更多
记录下来,以便以后查看
thinking in java 4th
chapter one
resuing the implementation
The simplest way to reuse a class is to just use an object of that class directly, but you can also place an object of that class inside a new class. We call this “creating a member object.” Your new class can be made up of any number and type of other objects, in any combination that you need to achieve the functionality desired in your new class. Because you are composing a new class from existing classes, this concept is called composition (if the composition happens dynamically, it’s usually called aggregation). Composition is often referred to as a “has-a” relationship, as in “A car has an engine.”
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics