package com.heima;
public class Person {
protected Person(){}
protected void eat(){
System.out.println("吃饭");
}
}
package com.baidu;
import com.heima.Person;
public class Student extends Person{
public static void main(String[] args){
//Student s = new Student();
//s.eat();
Person p = new Person();
}
public void study (){
System.out.println("好好学习");
}
}
为什么编译 Person p = new Person(); 不能通过 ,希望大声能解释一下!!!
|
|