Object-Oriented Design and Programming (Java). 2 Topics Covered Today 2.1 Implementing Classes –2.1.3 Method equals and Method toString –1.2.6 Implementing.

Slides:



Advertisements
Similar presentations
第六章 数组与字符串 §6.1 数组 §6.2 字符串. §6.1 数组 数组的创建 ( 一维数组和二维数组;基本数据类型和 复合数据类型) 1. 指定数组名称、数据类型 type var_name[]; 如: char s[]; Object o[]; int i[][];
Advertisements

Background. 7 月 20 日 Background 7 月 20 日 我原以为这是平凡的一天.
Chapter 11 Inferences About Population Variances
在近年的高考地理试题中,考查地球上 两点间最短航线的方向问题经常出现,由于 很多学生对这类问题没有从本质上搞清楚, 又缺乏空间想象能力,只是机械地背一些结 论,造成解这类题目时经常出错。 地球上两点间的最短航线方向问题.
HistCite 结果分析示例 罗昭锋. By:SC 可能原因:文献年度过窄,少有相互引用.
位置相关查询处理 研究背景及意义 移动计算、无线通信以及定位技术的快速发展,使 得位置相关的查询处理及基于位置的信息服务技术 已经成为一个热点研究领域 。 大量的应用领域 ( 如地理信息系统、智能导航、交 通管制、天气预报、军事、移动电子商务等 ) 均迫 切需要有效地查询这些数据对象。
§4.3 多重共线性 Multi-Collinearity. 一、多重共线性的概念 二、实际经济问题中的多重共线性 三、多重共线性的后果 四、多重共线性的检验 五、克服多重共线性的方法 六、案例 * 七、分部回归与多重共线性 §4.3 多重共线性.
第二章 数据信息 自然语言 字 -  单词 -  句子-  语言 计算机语言 字符-  词法单位-  程序-  语言 ↑ 词法 文法.
嵌入式操作系统 陈香兰 Fall 系统调用 10/27/09 嵌入式 OS 3/12 系统调用的意义  操作系统为用户态进程与硬件设备进行交互提供 了一组接口 —— 系统调用  把用户从底层的硬件编程中解放出来  极大的提高了系统的安全性  使用户程序具有可移植性.
地理信息系统概述. 数据和信息 (Data & Information) 数据 原始事实 如:员工姓名, 数据可以有数值、图形、声音、视觉数据等 信息 以一定规则组织在一起的事实的集合。
第 2 章 数据流分析 内容概述 数据流分析推导的是数据沿着程序执行路 径流动的信息 – 过程内的分析:可用表达式分析、到达-定值分 析等 – 过程间分析 –Shape 分析 – 理论基础 – 数据流方程的求解.
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第六十二讲 ) 离散数学. 最后,我们构造能识别 A 的 Kleene 闭包 A* 的自动机 M A* =(S A* , I , f A* , s A* , F A* ) , 令 S A* 包括所有的 S A 的状态以及一个 附加的状态 s.
Introduction to Java Programming Lecture 17 Abstract Classes & Interfaces.
1 为了更好的揭示随机现象的规律性并 利用数学工具描述其规律, 有必要引入随 机变量来描述随机试验的不同结果 例 电话总机某段时间内接到的电话次数, 可用一个变量 X 来描述 例 检测一件产品可能出现的两个结果, 也可以用一个变量来描述 第五章 随机变量及其分布函数.
第 5 章 分布式文件管理 中国科技大学软件学院 丁箐. 2 主要内容 5.1 分布式文件5.1 分布式文件设计 5.2 分布式文件系统的实现 5.3 分布式文件系统的5.3 分布式文件系统的趋势.
第十一章 曲线回归 第一节 曲线的类型与特点 第二节 曲线方程的配置 第三节 多项式回归.
第二部分 行政法律关系主体 第一节 行政主体 一、行政主体 (一)行政主体的概念 cc (二)行政主体资格含义及构成要件 CASE1CASE1\CASE2CASE2 (三)行政主体的职权和职责 1 、行政职权的概念及内容 2 、行政职权的特点 3 、行政职责.
线性代数习题课 吉林大学 术洪亮 第一讲 行 列 式 前面我们已经学习了关 于行列式的概念和一些基本 理论,其主要内容可概括为:
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第二十五讲 ) 离散数学. 定理 群定义中的条件 ( 1 )和( 2 )可以减弱如下: ( 1 ) ’ G 中有一个元素左壹适合 1 · a=a; ( 2 ) ’ 对于任意 a ,有一个元素左逆 a -1 适 合 a -1 ·
1 应用计量分析在公共财政领域的应用黄智聪 厦门大学财政系研究生课程 课程名称:应用计量分析在公共财政领域的 应用 授课老师:黄智聪 授课内容: 简单线性回归模型: 共线性与虚拟变数 参考书目: Hill, C. R., W. E. Griffiths, and G. G. Judge, (2001),
第 4 章 过程与变量的作用范围. 4.1 Visual Basic 的代码模块 Visual Basic 的应用程序是由过程组成的, 过程代码存放在模块中。 Visual Basic 提供了 三类模块,它们是窗体模块、标准模块和类 模块。 窗体模块 窗体模块是大多数 Visual Basic.
数 学 系 University of Science and Technology of China DEPARTMENT OF MATHEMATICS 第 3 章 曲线拟合的最小二乘法 给出一组离散点,确定一个函数逼近原函数,插值是这样的一种手段。 在实际中,数据不可避免的会有误差,插值函数会将这些误差也包括在内。
自顶向下分析 —— 递归下降法 递归下降法 (Recursive-Descent Parsing) 对每个非终极符按其产生式结构产生相应语 法分析子程序. 终极符产生匹配命令 非终极符则产生调用命令 文法递归相应子程序也递归,所以称这种方 法为递归子程序方法或递归下降法。
1 应用计量分析在公共财政领域的应用黄智聪 厦门大学财政系研究生课程 课程名称:应用计量分析在公共财政领域的 应用 授课老师:黄智聪 授课内容: 时间序列与横断面资料的共用 參考書目: Hill, C. R., W. E. Griffiths, and G. G. Judge, (2001), Undergraduate.
非均相物系的分离 沉降速度 球形颗粒的 :一、自由沉降 二、沉降速度的计算 三、直径计算 1. 试差法 2. 摩擦数群法 四、非球形颗粒的自由沉降 1. 当量直径 de :与颗粒体积相等的圆球直径 V P — 颗粒的实际体积 2. 球形度  s : S—— 与颗粒实际体积相等的球形表面积.
第十三章 多重继承和多重替换 Multiple Inheritance and Multiple Substitutability 多重继承 — 当一个子类从一个以上的超 类型继承属性和方法 多从替代 — 不同类型的对象之间的相互 替代.
量子化学 第四章 角动量与自旋 (Angular momentum and spin) 4.1 动量算符 4.2 角动量阶梯算符方法
化学系 3 班 何萍 物质的分离原理 世世界上任何物质,其存在形式几乎均以混合 物状态存在。分离过程就是将混合物分成两 种或多种性质不同的纯物质的过程。 分分子蒸馏技术是一种特殊的液-液分离技术。
数 学 系 University of Science and Technology of China DEPARTMENT OF MATHEMATICS 第 5 章 解线性方程组的直接法 实际中,存在大量的解线性方程组的问题。很多数值方 法到最后也会涉及到线性方程组的求解问题:如样条插值的 M 和.
主讲教师:陈殿友 总课时: 124 第十一讲 极限的运算法则. 第一章 二、 极限的四则运算法则 三、 复合函数的极限运算法则 一 、无穷小运算法则 机动 目录 上页 下页 返回 结束 §5 极限运算法则.
在发明中学习 线性代数 概念的引入 李尚志 中国科学技术大学. 随风潜入夜 : 知识的引入 之一、线性方程组的解法 加减消去法  方程的线性组合  原方程组的解是新方程的解 是否有 “ 增根 ” ?  互为线性组合 : 等价变形  初等变换  高斯消去法.
§2.2 一元线性回归模型的参数估计 一、一元线性回归模型的基本假设 二、参数的普通最小二乘估计( OLS ) 三、参数估计的最大或然法 (ML) 四、最小二乘估计量的性质 五、参数估计量的概率分布及随机干 扰项方差的估计.
第一节 相图基本知识 1 三元相图的主要特点 (1)是立体图形,主要由曲面构成; (2)可发生四相平衡转变; (3)一、二、三相区为一空间。
9的乘法口诀 1 .把口诀说完全。 二八( ) 四六( ) 五八( ) 六八( ) 三七( ) 三八( ) 六七( ) 五七( ) 五六( ) 十六 四十八 四十二 二十四 二十一 三十五 四十 二十四 三十 2 .口算, 并说出用的是哪句口诀。 8×8= 4×6= 7×5= 6×8= 5×8=
最 小 公 倍 数最 小 公 倍 数 最 小 公 倍 数最 小 公 倍 数. 例题 顺次写出 4 的几个倍数和 6 的几个倍数,它们 公有的倍数是哪几个?其中最小的是多少? 4 的倍数有 : 4 , 8 , 12 , 16 , 20 , 24 , 28 , 32 , 36 , … 6 的倍数有 :
25  C 时电解质水溶液的摩尔电导率 p.290. 注意强、弱电解质溶液的区别 p HCl KCl HAc 430.
Introduction to Java Programming Lecture 12 Method Benefits, Declaring, and Calling Methods.
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第五十三讲 ) 离散数学. 定义 设 G= ( V , T , S , P ) 是一个语法结构,由 G 产生的语言 (或者说 G 的语言)是由初始状态 S 演绎出来的所有终止符的集合, 记为 L ( G ) ={w  T *
编译原理总结. 基本概念  编译器 、解释器  编译过程 、各过程的功能  编译器在程序执行过程中的作用  编译器的实现途径.
数 学 系 University of Science and Technology of China DEPARTMENT OF MATHEMATICS 第 8 章 常微分方程 实际中,很多问题的数学模型都是微分方程。我们 可以研究它们的一些性质。但是,只有极少数特殊的方程 有解析解。对于绝大部分的微分方程是没有解析解的。
Department of Mathematics 第二章 解析函数 第一节 解析函数的概念 与 C-R 条件 第二节 初等解析函数 第三节 初等多值函数.
1 第 7 章 存储过程、触发器和程序包 在很多时候,都需要保存 PL/SQL 程序块,以便 随后可以重新使用。这也意味着,程序块需要一个名 称,这样需才可以调用或者引用它。命名的 PL/SQL 程序块可被独立编译并存储在数据库中,任何与数据 库相连接的应用程序都可以访问这些存储的 PL/SQL 程序块。
SMIE-121 Software Design II School of Mobile Information Engineering, Sun Yat-sen University Lecture.
Java 程序设计 Java Programming Fall, Chapter 7 Interfaces 2/44 Contents Single vs. Multiple Inheritance Abstract Classes Interface.
Introduction to Automatic Control The Laplace Transform Li Huifeng Tel:
Chapter 8 Algorithms. Understand the concept of an algorithm. Define and use the three constructs for developing algorithms: sequence, decision, and repetition.
1 、如果 x + 5 > 4 ,那么两边都 可得 x >- 1 2 、在- 3y >- 4 的两边都乘以 7 可得 3 、在不等式 — x≤5 的两边都乘以- 1 可得 4 、将- 7x — 6 < 8 移项可得 。 5 、将 5 + a >- 2 a 移项可得 。 6 、将- 8x < 0.
Object-Oriented Programming (Java). 2 Topics Covered Today Unit 1.2 Designing Classes –1.2.1 UML Class Diagrams –1.2.2 Relationships Between Classes –1.2.3.
名探柯南在侦查一个特大盗窃集团过程 中,获得藏有宝物的密码箱,密码究竟 是什么呢?请看信息: ABCDEF( 每个字 母表示一个数字 ) A :是所有自然数的因数 B :既有因数 5 ,又是 5 的倍数 C :既是偶数又是质数 D :既是奇数又是合数 EF :是 2 、 3 、 5 的最小公倍数.
Overriding toString()
7 生产费用在完工产品与在产 品之间分配的核算. 2 第七章 生产费用在完工产品与在产品之 间的分配  知识点 :  理解在产品的概念  掌握生产费用在完工产品与在产品之间的分 配.
力的合成 力的合成 一、力的合成 二、力的平行四边形 上一页下一页 目 录 退 出. 一、力的合成 O. O. 1. 合力与分力 我们常常用 一个力来代替几个力。如果这个 力单独作用在物体上的效果与原 来几个力共同作用在物体上的效 果完全一样,那么,这一个力就 叫做那几个力的合力,而那几个 力就是这个力的分力。
演示场景. 类图 配置 HibernateApplicationContext.xml hibernate.cfg.xml 创建数据库 – ooad/ooad 关于 Library/Project 模板.
向日葵的花盘 画一画 用圆规画圆用圆规画圆 用圆规画圆用圆规画圆 用圆规画圆的方法: ( 1 )把圆规的两脚分开,定好两脚间 的距离(定长) ( 2 )把有针尖的一只脚固定在一点上 (定点) ( 3 )把装有铅笔尖的一只脚旋转一周 ,就画出一个圆(旋转)
Application development with Java Lecture 21. Inheritance Subclasses Overriding Object class.
异核编辑谱 生物大分子波谱学原理 吴季辉 一般异核编辑谱由同核 NOESY 或 TOCSY 同 HSQC 或 HMQC 串接成,提供的信息 类似同核谱,但是谱峰在与 1 H 核相关的 13 C 或 15 N 核的化学位移上展开以解决同 核谱重叠的问题。其中异核编辑的 NOESY 谱是最后结构计算所需的.
八. 真核生物的转录 ㈠ 特点 ① 转录单元为单顺反子( single cistron ),每 个蛋白质基因都有自身的启动子,从而造成在功能 上相关而又独立的基因之间具有更复杂的调控系统。 ② RNA 聚合酶的高度分工,由 3 种不同的酶催化转 录不同的 RNA 。 ③ 需要基本转录因子与转录调控因子的参与,这.
1 Object-Oriented Programming Inheritance. 2 Superclasses and Subclasses Superclasses and Subclasses  Superclasses and subclasses Object of one class.
§8.1 时间序列平稳性和单位根检验 Stationary Time Serial and Unit Root Test 一、时间序列的平稳性 二、单整序列 三、单位根检验.
3D 仿真机房建模 哈尔滨工业大学 指导教师:吴勃英、张达治 蒋灿、杜科材、魏世银 机房尺寸介绍.
1 第三章 数列 数列的概念 考点 搜索 ●数列的概念 ●数列通项公式的求解方法 ●用函数的观点理解数列 高考 猜想 以递推数列、新情境下的 数列为载体, 重点考查数列的通 项及性质, 是近年来高考的热点, 也是考题难点之所在.
第二节. 广告牌为什么会被风吹倒? 结构的稳定性: 指结构在负载的作用下 维持其原有平衡状态的能力。 它是结构的重要性质之一。
UNIT 5: Determiners 本单元学习目标: 辨别不同类型的限定词; 了解限定词与名词的搭配关系; 掌握不同类型的句子中限定词的使用方法。 主讲教师:张朝霞.
目录 上页 下页 返回 结束 二、无界函数反常积分的审敛法 * 第五节 反常积分 无穷限的反常积分 无界函数的反常积分 一、无穷限反常积分的审敛法 反常积分的审敛法  函数 第五章 第五章.
打孔机生产效能的提高 北方民族大学: 高 义(教师) 张重威 赵 乾 杨 飞. 打孔机生产效能的提高 北方民族大学 分析 1 过孔方案 2 生产效能 3 扩展与深化 4.
§7.2 估计量的评价标准 上一节我们看到,对于总体 X 的同一个 未知参数,由于采用的估计方法不同,可 能会产生多个不同的估计量.这就提出一 个问题,当总体的一个参数存在不同的估 计量时,究竟采用哪一个好呢?或者说怎 样评价一个估计量的统计性能呢?下面给 出几个常用的评价准则. 一.无偏性.
Session 03 - Templates Outline 03.1Introduction 03.2Function Templates 03.3Overloading Template Functions 03.4Class Templates 03.5Class Templates and Non-type.
Chapter 6 Reusing Classes.
OO Design with Inheritance
Building Java Programs
Presentation transcript:

Object-Oriented Design and Programming (Java)

2 Topics Covered Today 2.1 Implementing Classes –2.1.3 Method equals and Method toString –1.2.6 Implementing Classes the Library System

3 The Object Class Java defines the class java.lang.Object that is defined as a superclass for all classes. If a class doesn’t specify explicitly which class it is derived from, then it will be implicitly derived from class Object. So, in the previous example, Employee was derived from Person which in turn was derived from Object.

4 Person Employee Object Class Hierarchy Diagram

5 Method toString in Object Class The Object class defines a set of methods that are inherited by all classes. One of these is the toString() method that is used whenever we want to get a String representation of an object. The version of toString method defined in class Object returns a String with the following format: When you define a new class, you can override the toString() method in order to have a suitable representation of the new type of objects as Strings.

6 Point public class Point { private int x,y; public Point(int initialX, int initialY) { x = initialX; y = initialY; } public int getX() { return x; } public int getY() { return y; } public String toString() { return "(" + getX() + "," + getY() + ")"; }

7 Method toString Point pointOne = new Point(10, 100); Point pointTwo = new Point(-20, 200); Point pointThree = new Point(50, -500); System.out.println(pointOne); System.out.println(pointTwo); System.out.println(pointThree); System.out.println(); Output : (10,100) (-20,200) (50,-500)

8 Method equals In JAVA, all classes inherit the equals() method of Object class. This default implementation is exactly the same as obj1 == obj2 (compare pointers) boolean equals(Object obj)

9 Compare Point objects Point pointOne = new Point(10, 100); Point pointTwo = new Point(10, 100); Point pointThree = pointOne; if (pointOne.equals(pointTwo)) { System.out.println("pointOne and pointTwo are equal"); } else { System.out.println("pointOne and pointTwo are different"); } if (pointOne.equals(pointThree)) { System.out.println("pointOne and pointThree are equal"); } else { System.out.println("pointOne and pointThree are different");}

10 Compare Point objects pointOnepointTwo pointThree (null) Point pointOne = new Point(10, 100); Point pointTwo = new Point(10, 100); Point pointThree = pointOne;

11 Compare Point objects pointOnepointThree (null) Point pointOne = new Point(10, 100); Point pointTwo = new Point(10, 100); Point pointThree = pointOne; pointTwo

12 Compare Point objects pointOnepointThree Point pointOne = new Point(10, 100); Point pointTwo = new Point(10, 100); Point pointThree = pointOne; pointTwo

13 Compare Point objects Point pointOne = new Point(10, 100); Point pointTwo = new Point(10, 100); Point pointThree = pointOne; pointOne pointThree X=10 Y=100 pointTwo X=10 Y=100

14 Override method equals public boolean equals(Object object) { if (object instanceof Point) { Point point = (Point) object; return point.getX() == getX() && point.getY() == getY(); } else { return false; } } 在大部分类中继承自 Object 类的 equals() 方法都不太适用, 因此每个类都需要重写该方法; 该方法比较两个对象,只有当两个对象的状态都一样时, 返回 true ;

15 Override method equals Point pointOne = new Point(10, 100); Point pointTwo = new Point(10, 100); Point pointThree = new Point(50, 500); if (pointOne.equals(pointTwo)) { System.out.println("pointOne and pointTwo are equal"); } else { System.out.println("pointOne and pointTwo are different"); } if (pointOne.equals(pointThree)) { System.out.println("pointOne and pointThree are equal"); } else { System.out.println("pointOne and pointThree are different"); }

overload 和 override 的区别 16 override (重写) 1 、方法名、参数、返回值相 同。 2 、子类方法不能缩小父类方 法的访问权限。 3 、子类方法不能抛出比父类 方法更多的异常 ( 但子类方法 可以不抛出异常 ) 。 4 、存在于父类和子类之间。 5 、方法被定义为 final 不能被 重写。 overload (重载) 1 、参数类型、个数、顺 序至少有一个不相同。 2 、不能重载只有返回值 不同的方法名。 3 、存在于父类和子类、 同类中。

Implementing Classes the Library System

18 Part of Class Diagram

19 Class CatalogItem public class CatalogItem { /* Code of the item. */ private String code; /* Title of the item. */ private String title; /* Year the item was published. */ private int year; /* Indicates if the item is available */ private boolean available;

20 Class CatalogItem /** * Constructs a CatalogItem object. * * Sets the instance variable available * to true. * * initialCode the code of the item. initialTitle the title of the item. initialyear the year the item was published. */ public CatalogItem(String initialCode, String initialTitle, int initialyear) { code = initialCode; title = initialTitle; year = initialyear; available = true; }

21 Class CatalogItem /** * Returns the code of this item. * the code of this item. */ public String getCode() { return code; } /** * Returns the title of this item. * the title of this item. */ public String getTitle() { return title; } /** * Returns the year this item was published. * the year this item was published. */ public int getYear() { return year; }

22 Class CatalogItem /** * Sets the value of instance variable available. * value the new value. */ public void setAvailable(boolean value) { available = value; } /** * Returns true if the item is available. * true if the item is available; * false otherwise. */ public boolean isAvailable() { return available; }

23 Class CatalogItem /** * Returns true if the code of this catalog item * is equal to the code of the argument * * object object with which this catalog item is compared. true if the code of this catalog item is * equal to the code of the argument; false * otherwise. */ public boolean equals(Object object) { return object instanceof CatalogItem && getCode().equals(((CatalogItem) object).getCode()); }

24 Class CatalogItem /** * Returns the string representation of this catalog item. * the string representation of this catalog item. */ public String toString() { return getCode() + "_" + getTitle() + "_" + getYear() + "_" + isAvailable(); } }

25 Class Book public class Book extends CatalogItem { /* Author of the book.*/ private String author; /* Number of pages in the book.*/ private int numberOfPages;

26 Class Book /** * Constructs a Book object. * initialCode the code of the book. initialTitle the title of the book. initialYear the year the book was published. initialAuthor the author of the book. initialNumberOfPages the number of pages in the book. */ public Book(String initialCode, String initialTitle, int initialYear, String initialAuthor, int initialNumberOfPages) { super(initialCode, initialTitle, initialYear); author = initialAuthor; numberOfPages = initialNumberOfPages; }

27 Class Book /** * Returns the author of this book. * the author of this book. */ public String getAuthor() { return author; } /** * Returns the number of pages in this book. * the number of pages in this book. */ public int getNumberOfPages() { return numberOfPages; }

28 Class Book /** * Returns the string representation of this book. * the string representation of this book. */ public String toString() { return super.toString() + "_" + getAuthor() + "_" + getNumberOfPages(); } }

29 Class Recording /** * This class models a recording. It extends CatalogItem} and * adds the following information: * * the performer of the recording, a String * the format of the recording, a String * * author name CatalogItem */ public class Recording extends CatalogItem { /* Performer of the recording. */ private String performer; /* Format of the recording. */ private String format;

30 Class Recording /** * Constructs an Recording object. * initialCode the code of the catalog item. initialTitle the title of the catalog item. initialYear the year of the catalog item. initialPerformer the performer of the recording. initialFormat the format of the recording. */ public Recording(String initialCode, String initialTitle, int initialYear, String initialPerformer, String initialFormat) { super(initialCode, initialTitle, initialYear); performer = initialPerformer; format = initialFormat; }

31 Class Recording /** * Returns the performer of this recording. * the performer of this recording. */ public String getPerformer() { return performer; } /** * Returns the format of this recording. * the format of this recording. */ public String getFormat() { return format; }

32 Class Recording /** * Returns the string representation of this recording. * the string representation of this recording. */ public String toString() { return super.toString() + "_" + getPerformer() + "_ “ + getFormat(); } }

33 Class Borrower /** * This class models a library user. It contains the following * information: * * the id of the borrower, a String * the name of the borrower, a String * * author name */ public class Borrower { /* Identification number of the borrower.*/ private String id; /* Name of the borrower.*/ private String name;

34 Class Borrower /** * Constructs a Borrower object. * initialId the identification number of the borrower. initialName the name of the borrower. */ public Borrower(String initialId, String initialName) { id = initialId; name = initialName; }

35 Class Borrower /** * Returns the identification number of this borrower. * the identification number of this borrower. */ public String getId() { return id; } /** * Returns the name of this borrower. * the name of this borrower. */ public String getName () { return name; }

36 Class Borrower /** * Returns true if the id of this borrower is * equal to the id of the argument. * * object object with which this borrower is compared. true if the id of this borrower is * equal to the id of the argument; false * otherwise. */ public boolean equals(Object object) { return object instanceof Borrower && getId().equals(((Borrower) object).getId()); }

37 Class Borrower /** * Returns the string representation of this borrower. * the string representation of this borrower. */ public String toString() { return getId() + "_" + getName(); } }