package ocjp;
import java.util.ArrayList;
interface Universe{
public void doStuff();
}
class Star{
public void doStuff(){
System.out.println("twinkling star");
}
}
class Sun extends Star implements Universe{
public void doStuff(){
System.out.println("Shinning sun");
}
}
public class Test {
public static void main(String[] args) {
ArrayList<String> arrayList = new ArrayList<String>();
Sun obj2 = new Sun();
Star obj3 = obj2;
((Sun) obj3 ).doStuff();
((Star)obj2 ).doStuff();
((Universe)obj2).doStuff();
}
}