About Question enthuware.ocajp.i.v7.2 . 1390 :
Posted: Thu Feb 12, 2015 7:09 am
Why option A is not correct? I am using kindle edition, might be its old one(I purchased it in November-2014). I wrote this code which is fine.
Code: Select all
package com.oracle.certification.OnlyInheritance;
class Sub extends Super implements Tone{
public void go()
{
System.out.println("Go! Go! Go!");
}
}
Code: Select all
package com.oracle.certification.OnlyInheritance;
public class Super {
public static void main(String args[])
{
Super s=new Sub();
((Tone)s).go();
}
}
Code: Select all
package com.oracle.certification.OnlyInheritance;
interface Tone {
void go();
}