静态对象不变量? [英] Static Object Invariants?
本文介绍了静态对象不变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
几个问题:
1)我是否可以在非静态类中使用静态对象不变量方法(验证静态成员)?
1.1)静态检查器是否真的会尊重它,如果是的话?
2)我可以在静态类中使用静态对象不变量方法吗? - 我应该吗?
2.1)同样,静态检查员会关心吗?
1) Can I have a static object invariant method in a non-static class (which validates static members)?
1.1) Will the static checker actually respect it, if so?
2) Can I have a static object invariant method in a static class - and should I?
2.1) Again, will the static checker care about it?
提前致谢!
推荐答案
您好Alex,
Hi Alex,
我认为目前尚未选中静态字段。 见Manuel的回复:
I believe that static fields are currently unchecked. See Manuel's reply:
- 戴夫
这篇关于静态对象不变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文