码迷,mamicode.com
首页 > 编程语言 > 详细

Java Aggregation (HAS-A relationship)

时间:2016-06-26 23:51:59      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:

Aggregation (HAS-A)

HAS-A relationship is based on usage, rather than inheritance. In other words, class A has-a relationship with class B, if code in class A has a reference to an instance of class B.

 

example

class Student
{
 String name;
 Address ad;
}

here we say that student has-a address

技术分享

 

 

 

 




Java Aggregation (HAS-A relationship)

标签:

原文地址:http://www.cnblogs.com/morningdew/p/5618879.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!