You can’t just make a static call like Example.EXAMPLE5
, because it simply won’t compile. In case of executing out-of-date Jar it will throw some kind of runtime error when parsing the bytecode.
The only sensible example I could think of would be a data parsing like with Jackson, JAXB, etc. If you want to avoid null
values you could then use default values or Null Object pattern depending on your case.