.两个类的关系:(A,B 两个类)
1.一对一,A中定义一个B的属性
Eg.A == Student B == name/id
Eg. == People B ==Pet
2.一对多,A中定义一个B的ArrayList
Eg.A ==Manager B==Student
3.多对多。增加C类记录A和B的对应关系。
Eg.A == Student B ==record C== Course D
posted on 2017-11-19 15:56 杨先森的博客 阅读(144) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 杨先森的博客 Powered by .NET 9.0 on Kubernetes