第九行错误显示:the method setCore(int) is undefined for the type Car.
第十行错误显示:the method getCore(int) is undefined for the type Car.
public class Car{
private int core;
public void setCore(int core){
this.core = core;
}
public int getCore(){
return this.core
}
Car hello = new Car();
System.out.print(hello.core(6));
不是,你自己的类名是Inicar,创建类的对象也是 IniCar hello = new IniCar();
代码我看着没问题,你应该是没保存,保存一下再运行