import static packagename.classname.variablename
variablename重复的话,上面的import static packagename.classname.variablename会无效
package ex7;
public class Sample {
public final static int VALUE = 100;
}
package ex7;
import static ex7.Sample.VALUE;
public class Main {
private final static int VALUE = 820;
public static void main(String...addddd) {
System.out.println(VALUE);
}
}
到此结束。