Variables in Interface

前端 未结 5 1995
长情又很酷
长情又很酷 2020-12-11 02:05

Why is that a variable used in an Interface is PUBLIC STATIC FINAL? Why \"static\" in particular?

5条回答
  •  星月不相逢
    2020-12-11 02:40

    Because you can not instantiate an interface. Also there cannot be any method body to use a non-static non-final variable.

提交回复
热议问题