Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一个开始的域
class MyDomain { /* pre injuries board */ Boolean isSomething = false
有没有办法在不实例化对象的情况下获得默认值?
不,不是没有做这样的事情:
class MyDomain { public static final Boolean IS_SOMETHING_DEFAULT = false Boolean isSomething = IS_SOMETHING_DEFAULT ... }
之后...
Boolean myDomainDefault = MyDomain.IS_SOMETHING_DEFAULT