package day10;
//水果类
public class Fruit {
}
class fruit{
}//苹果类继承水果类
package day10;
public class Apple extends Fruit{
}
package day10;
public class Pear extends Fruit{
}//梨类继承水果类
package day10;
public class Sample09 {
public static void main(String args[]){
Fruit f = new Apple();
Pear p = f;
}
}
这个问题出哪了、、、倒数第三行 Pear p = f;
在f位置报错。。碉堡了
|