Redian新闻
>
us bank flexperks最近retention有没有dp
avatar
us bank flexperks最近retention有没有dp# Money - 海外理财
S*C
1
第二个是design problem 不用写代码,给 car Honda, color, engine, Vehicle(单车
也包括在内) drive.让写他们之间的关系。
写几句话就可以了。
____________
Vehicle is an interface which declares a method drive().
Car Honda is abstract class that extends Vehicle. Car also has engine and
color as member variable.
The relationship between Vehicle and Car is inheritance.
The relationship between engine/color and Car is composition.
avatar
y*7
2
rt..上个月年费刚post, 想问问有没有免年费的dp
avatar
p*2
3
composition 不是这个意思吧?

【在 S*******C 的大作中提到】
: 第二个是design problem 不用写代码,给 car Honda, color, engine, Vehicle(单车
: 也包括在内) drive.让写他们之间的关系。
: 写几句话就可以了。
: ____________
: Vehicle is an interface which declares a method drive().
: Car Honda is abstract class that extends Vehicle. Car also has engine and
: color as member variable.
: The relationship between Vehicle and Car is inheritance.
: The relationship between engine/color and Car is composition.

avatar
S*C
4
那是aggregation?

【在 p*****2 的大作中提到】
: composition 不是这个意思吧?
avatar
n*s
5
I would think that car:engine association is composition but
Car:color association is aggregation.

【在 p*****2 的大作中提到】
: composition 不是这个意思吧?
avatar
g*g
6
color is an attribute of car.

【在 n*******s 的大作中提到】
: I would think that car:engine association is composition but
: Car:color association is aggregation.

avatar
n*s
7
That is my first understanding as well

【在 g*****g 的大作中提到】
: color is an attribute of car.
avatar
n*s
8
And the question is what is the relationship between
Class Car and Class Color, is it not aggregation?
avatar
n*s
9
By the word, it certainly does not feel like it is.
avatar
p*2
10
color is not a class
用oo不能教条呀
不是什么都是object的

【在 n*******s 的大作中提到】
: And the question is what is the relationship between
: Class Car and Class Color, is it not aggregation?

avatar
n*s
11
Color可以是class吧,不过这些乱七八糟的说法都是Booch那帮人瞎编的,
我也是真不清楚。

【在 p*****2 的大作中提到】
: color is not a class
: 用oo不能教条呀
: 不是什么都是object的

avatar
S*C
12
The best way to define Color is enum.

【在 p*****2 的大作中提到】
: color is not a class
: 用oo不能教条呀
: 不是什么都是object的

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。