abstruct class SuperClass{
abstruct void display();
}
public class SubClassA extends SuperClass{
public void display(){
System.out.println("SubClassA ");
public class SubClassB extends SuperClass{
System.out.println("SubClassB ");
public class PolyTester{
public static void main(String[] argc){
SuperClass sa = new SubClassA();
SuperClass sb = new SubClassB();
SuperClass[] sc = {sa,sb};
for(int i=0; i
abstruct class SuperClass{
abstruct void display();
}
public class SubClassA extends SuperClass{
public void display(){
System.out.println("SubClassA ");
}
}
public class SubClassB extends SuperClass{
public void display(){
System.out.println("SubClassB ");
}
}
public class PolyTester{
public static void main(String[] argc){
SuperClass sa = new SubClassA();
SuperClass sb = new SubClassB();
SuperClass[] sc = {sa,sb};
for(int i=0; i