GeometricObject是一个抽象类,当我尝试运行测试代码(如下所示)时,出现错误“无法实例化GeometricObject的类型” 有什么想法要解决吗?
import geometricobject.GeometricObject;
public class TestGeometricObject {
public static void main(String[] args)
{
GeometricObject obj1 = new GeometricObject();
GeometricObject obj2 = new GeometricObject("blue", true);
System.out.println("Object 1: " + obj1.toString());
System.out.println("Object 2: " + obj2.toString());
}
}