注意抽象类如何定义一个构造函数,该函数接收属性的一个map—我总是可以稍后添加更多构造函数,稍后我就会这么做。
Note how the abstract class defines a constructor that takes a Map of properties - I can always add more constructors later, and I will shortly.
从下述抽象中选择一个(或一个自己定义的抽象),确定类中需要什么数据,并提供适当的构造函数集。解释你的决定。
Choose one of the following abstractions (or an abstraction of your own choosing). Determine what data is needed in the class. Provide an appropriate set of constructors. Explain your decisions.
所有许可都有一个名称(解释依赖于子类)和用于定义特定的Permission子类语义的抽象函数。
All permissions have a name (whose interpretation depends on the subclass), as well as abstract functions for defining the semantics of the particular permission subclass.
应用推荐