import javax.swing.*;
class H9Ex1 {
public static void main(String args[])
{point     n   = new point(7,11);
 circle    d   = new circle(3.5,22,8);
 cylinder  s   = new cylinder(10,3.3,10,10);
 shape     a[] = new shape[3];
 a[0]=n;
 a[1]=d;
 a[2]=s; 
 String s2="direct call : \n";
        s2+=n.name()+": "+n.toString()+"\n";
        s2+=d.name()+": "+d.toString()+"\n";
        s2+=s.name()+": "+s.toString()+"\n";
        s2+="indirect call : \n";
 for(int i=0;i<a.length;i++)
 {s2+=a[i].name()+": "+a[i].toString()+"\n";}
 String s1="indirect adress use";
 JOptionPane.showMessageDialog(null,s2,s1,JOptionPane.PLAIN_MESSAGE);
}
}
