interface t{
int counter = 40;
}class hello implements t{
private static int counter; public static void main(String[] args) throws FileNotFoundException {
System.out.println(counter);
}
}请问为什么输出是0啊??
int counter = 40;
}class hello implements t{
private static int counter; public static void main(String[] args) throws FileNotFoundException {
System.out.println(counter);
}
}请问为什么输出是0啊??
所以父类中的变量被覆盖了。