我想实现的是下面的类层次结构。(请注意,以下代码片段将无法执行,因为它既不是语法正确的PHP,也不是Doctrine注释的正确用法。)$location; // any subclass of location can go here现在,对于位置的子类,我们可以以City、State和Country为例。有关此类层次结构的更多信息,请参见:
class Adress { $parent; /* of type City, ... some other attribu
我尝试执行下面的java代码,它演示了单个继承。vol = box.volume(); }但这会引发以下错误:BoxWeight.java:16: error: constructor Box in class Box cannot be applied to givenBoxWeight(double