简体   繁体   English

是否可以在某个子类中使超类归为静态?

[英]is it possible to make an atribute of a superclass static in a certain subclass?

So, I have various sub classes of Store . 因此,我有Store各种子类。 and they all have rent . 他们都有rent problem is one specific subclass has the same rent for all instances of the class whilst the other ones can be whatever. 问题在于,一个特定的子类对于该类的所有实例具有相同的rent ,而其他子类可以是任意的。 That meaning that the class in question, Quiosque has a static rent. 这意味着所讨论的班级Quiosque具有静态租金。 is there a way to to make this precise atribute static wihle still inhereting Store ? 有没有办法使这种精确的属性static信息仍然Store

this is the class diagram. 这是类图。 rendaFixa is what i called rent and renda is just there because i'm still thinking as to what to do about this class. rendaFixa是我所谓的rent而renda就在那儿,因为我仍在思考该课程的处理方法。 i konw this is confusing, sorry 我知道这很令人困惑,对不起

https://gyazo.com/f0f353885647fc0dd63a8c9b13b47695 https://gyazo.com/f0f353885647fc0dd63a8c9b13b47695

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM