static 和 interface的關係:
1)內部接口是隱式的靜態的,不管你是不是用static來修飾
注意:內部接口很少用到
2)外部接口不能是靜態的,就像外部類
3)接口的所有的成員(屬性與方法)是隱式的public的。
4)接口中所有的屬性是隱式的static和final的
5)接口中所有的方法不能定義爲static
6)接口中所有的被定義的類都是隱式的static的
static 和 interface的關係
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
初始化順序(Thinking in Java中的一段有意思的例子)
abstract class Glyph { abstract void draw(); Glyph() { System.out.prin
happyzhm5
2020-06-25 22:36:57
Can inner class extends outer class, or opposite?
happyzhm5
2020-02-25 15:57:58
if the reference of the thread is set to null.
happyzhm5
2020-02-25 15:57:58
In what situation, an IllegalThreadStateException will be thrown?
happyzhm5
2020-02-25 15:57:58
Why this code compile OK, but throw ClassCastException at run time?
happyzhm5
2020-02-25 15:57:58
初始化順序(Thinking in Java中的一段有意思的例子)
abstract class Glyph { abstract void draw(); Glyph() { System.out.prin
happyzhm5
2020-06-25 22:36:57
Can inner class extends outer class, or opposite?
happyzhm5
2020-02-25 15:57:58
if the reference of the thread is set to null.
happyzhm5
2020-02-25 15:57:58
In what situation, an IllegalThreadStateException will be thrown?
happyzhm5
2020-02-25 15:57:58
Constructor or not constructor?
happyzhm5
2020-02-25 15:57:58
Why this code compile OK, but throw ClassCastException at run time?
happyzhm5
2020-02-25 15:57:58
Can one object access a private variable?
happyzhm5
2020-02-25 15:57:58
abstract method Graphics.drawString()?
happyzhm5
2020-02-25 15:57:58
關於線程同步的一點心得
happyzhm5
2018-08-31 04:31:24
24小時熱門文章