一道java面试题,有点迷糊
一个抽象类Test1:
public abstract class test1 {
int i=0;
}
一个接口Test2:
public interface test2 {
int i=2;
}
问题:请在下面横线处填写代码分别输出test1和test2中变量i的值
public class test3 extends test1 implements test2 {
public void print()
{
__________________
__________________
}
public static void main(String[] args) {
test3 t=new test3();
t.print();
}
}
今天去面试,不知道这道题怎么做,请大家看看!