这是我的代码:
public void start()
{
//If the gas tank and oil have more than nothing, and the transmission is in gear park, then the car can start
if((gasTank.getGasLevel() > 0) && (engine.getOilLevel() > 0) && (transmission.gearPark()))
{
engine.startEngine();
System.out.println("Engine is now on");
}
else
{
System.out.println("Please make sure your car is in proper gear, engine has oil and gas.");
}
}
我不断收到'void' type not allowed here
错误。我不想返回任何东西,所以我知道我不需要 int、Boolean、double 等。
我究竟做错了什么?