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();
}