package com.Summer_0427.cn; interface Info{ int N = 11;//public static final int N = 11; //抽象 //默認 default void df() { System.out.println("df"); } //不能被 子接口 和 實現類繼承的 public static void sf() { System.out.println("sf"); } } class InfoImpl implements Info{ public void show() { System.out.println(N);//繼承了父接口中的常量 // N = 56;//常量不可以修改 df();//可以被繼承過來 Info.sf();//靜態方法的調用,想不創建一個對象直接調用接口的方法,定義成一個靜態方法 } } public class TestInfo { public static void main(String[] args) { // TODO Auto-generated method stub } }