我有这样的抽象类和接口
abstract class ParentClass
{
int VALUE;
public abstract void display();
public void display2()
{
System.out.println("this is abstract class method");
}
}
interface parentInterface
{
int VALUE=88;
abstract void display();
void display2();
}
子类扩展并实现了上述内容,如下所示
class ChildClass extends ParentClass implements parentInterface
{
ChildClass()
{
super.VALUE=0;
//VALUE=0; //<=will give ambiguous property
}
@Override
public void display()
{
System.out.println("Current Class-"+this.getClass());
System.out.println("Integer value-"+super.VALUE);
}
public void display2()
{
//to call the method of abstract class
//call by using super.display2();
System.out.println("this is implemented method");
}
}
所以,我的问题是如何访问VALUE
ChildClass 中的接口变量?