[英]Is the composition relationship correct between a class and an enumeration?
No. That is simply contra-dictionary/nonsense. 不。那简直是矛盾/废话。 An enum is just one out of many.
一个枚举只是其中的一个。 A composition is (as the name says) composed of multiple things.
一个组成(顾名思义)是由多个事物组成的。 What you need here is a simple dependency which goes from
MyClass
to MyEnum
. 您需要的是从
MyClass
到MyEnum
的简单依赖MyEnum
。 Not more. 不多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.