如果父类是抽象类那么所以子类必须是都是抽象类吗
package java1;public abstract class Shape {
{
System.out.println("执行Shaps的初始会");
}
private String color;
public abstract double calPerimeter();
public abstract String getType();
public Shape(){}
public Shape(String color)
{
System.out.println("执行Shaps的初始构造器。。。");
this.color=color;
}
public abstract class Triangle extends Shape
{
private double a;
private double b;
private double c;
public Triangle(String color ,double a , double b , double c)
{
if(a>=b+c||b>=a+c||c>=a+b)
{
System.out.println("三角型两边之和必须大于第三班");
return;
}
this.a=a;
this.b=b;
this.c=c;
}
public double calPerimeter()
{
return a+b+c;
}
public String getType()
{
return "三角形";
}
public abstract class Circle extends Shape
{
}
}
}
几乎所以子类必须继承父类抽象类为什么是这样可是书籍上面源代码要求没有继承抽象类源代码abstract为什么这样