编写一个Shape类,具有属性:周长和面积;
定义其子类三角形和矩形,分别具有求周长的方法。
定义主类E,在其main方法中创建三角形和矩形类的对象,
并赋给Shape类的对象a、b,使用对象a、b来测试其特性。
package T092208;public class Shape { private int bian; private double zhouchang; private double mianji; public int getBian() { return bian; } public void setBian(int bian) { this.bian = bian; } public double getZhouchang() { return zhouchang; } public void setZhouchang(double zhouchang) { this.zhouchang = zhouchang; } public double getMianji() { return mianji; } public void setMianji(double mianji) { this.mianji = mianji; } public void bian(){ System.out.println("您创建了一个"+bian+"边形!"); }}package T092208;public class San extends Shape { double[] bianchang=new double[3]; San(){ } San(double a,double b, double c){ bianchang[0]=a; bianchang[1]=b; bianchang[2]=c; } public void zhouchang(){ if(getBian()==3&&bianchang[0]+bianchang[1]>bianchang[2]&&bianchang[0]-bianchang[1]