首页 > 编程语言 > 详细

Java Aggregation (HAS-A relationship)

时间:2016-06-26 23:50:58      阅读:290      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!