Public interface Constants{Int MAX=10000;Int MIN=1;}Public class Test{Public static void main(String[] args){Constants con=new Constants ();Sysout(con.MAX);Int i=50;If(i> Constants.MAX){Constants.MAX=i;}}}
接口Constants 不能实例化,直接用接口名称调用。