Why doesn't Java allow private members in interface?

后端 未结 13 1300
时光取名叫无心
时光取名叫无心 2020-12-07 13:11

Why doesn\'t Java allow private members in interface? Is there any particular reason?

13条回答
  •  醉梦人生
    2020-12-07 13:33

    Private members don't make sense in interface. Interface is a way to access a class with defined methods where you don't need to see the inners of that class.

    Private members disagree to that.

提交回复
热议问题