Short name for imported constant class fields

后端 未结 3 825
清歌不尽
清歌不尽 2021-01-21 01:48

I have a java program with hundreds of configuration constants:

public static final String C1=\"C1\";
public static final String C2=\"C2\";

Sin

3条回答
  •  旧巷少年郎
    2021-01-21 02:38

    You should static import. More details are here http://javapapers.com/core-java/what-is-a-static-import-in-java/

    You have it like : import static mynamespace.MyClassConstants.*;

提交回复
热议问题