Difference between final static and static final

前端 未结 7 1826
眼角桃花
眼角桃花 2020-12-04 06:39

I found a code where it declared code like

private final static String API_RTN_SUCCESS = \"0\";
private final static String API_RTN_ERROR = \"1\";

public st         


        
相关标签:
7条回答
  • 2020-12-04 07:26

    What is the difference between them or are they same?

    If you are talking about changing order of static and final then yes they are same.

    does it differ for private or public?

    No, you can use any order in private and public. Just difference is private variables will not be accessible outside of class directly.

    0 讨论(0)
提交回复
热议问题