Java Aggregation (HAS-A relationship)

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

				
时间: 2024-08-26 06:21:50

Java Aggregation (HAS-A relationship)的相关文章

Java Interview Reference Guide--reference

Part 1 http://techmytalk.com/2014/01/24/java-interview-reference-guide-part-1/ Posted on January 24, 2014 by Nitin Kumar JAVA Object Oriented Concepts Java in based on Object Oriented concepts, which permits higher level of abstraction to solve any p

Java内存模型-jsr133规范介绍

原文地址:http://www.cnblogs.com/aigongsi/archive/2012/04/26/2470296.html; 最近在看<深入理解Java虚拟机:JVM高级特性与最佳实践>讲到了线程相关的细节知识,里面讲述了关于java内存模型,也就是jsr 133定义的规范. 系统的看了jsr 133规范的前面几个章节的内容,觉得受益匪浅.废话不说,简要的介绍一下java内存规范. 什么是内存规范 在jsr-133中是这么定义的 A memory model describes,

hibernate的中的查询与级联操作

1.Criteria查询接口适用于组合多个限制条件来搜索一个查询集. 要使用Criteria,需要遵循以下步骤: *创建查询接口: Criteria criteria=session.createCriteria(User.class); *设置查询条件: criteria.add(Restrictions.gt("age",10); *查询数据:      List<User> list=criteria.list(); 2.关系映射:一个用户(cust_customer

Java Inheritance ( IS-A relationship)

Inheritance (IS-A) when a class extends another another class it inherits all non private members including fields and methods. Inheritence in Java can be best understood in terms of Parent and child relationship. also known as Super class and Sub cl

Thinking in Java,Fourth Edition(Java 编程思想,第四版)学习笔记(二)之Introduction to Objects

The genesis of the computer revolution was a machine. The genesis of out programming languages thus tends to look like that machine. 计算机革命起源于机器,因此编程语言的产生也始于对机器的模仿 Computers are mind amplification tools and a different kind of expressive medium. 计算机是大

【转】Java 专业词汇

原址:http://blog.csdn.net/xiaojunjuns1/article/details/52729861 abstract (关键字)             抽象 ['.bstr.kt] access                            vt.访问,存取 ['.kses]'(n.入口,使用权) algorithm                     n.算法 ['.lg.riem] annotation                     [Java

Java基础常见英语词汇

(转自http://www.jianshu.com/p/2743fe834166) Java基础常见英语词汇(共70个) ['?bd?ekt] ['?:rientid]导向的 ['pr??ɡr?m??]编程OO: object-oriented ,面向对象 OOP: object-oriented programming,面向对象编程 [d?'vel?pm?nt][k?t]工具箱 ['v??tj??l]虚拟的JDK:Java development kit, java开发工具包 JVM:java

《Java疯狂讲义》中关联、组合和聚合的谬误

本文參考例如以下资料(建议阅读): a). difference-aggregation-acquaintance-and-composition-as-used-by-gang-of-four b). AssociationVsAggregationVsComposition c). Design Patterns Elements of Reusable Object-Oriented Software d). Java疯狂讲义(第三版) 1. 问题的由来 我看到的是这本书的第三版,在2.2

Java性能提示(全)

http://www.onjava.com/pub/a/onjava/2001/05/30/optimization.htmlComparing the performance of LinkedLists and ArrayLists (and Vectors) (Page last updated May 2001, Added 2001-06-18, Author Jack Shirazi, Publisher OnJava). Tips: ArrayList is faster than