以下处理/Java代码有什么问题吗?
class SensorData{
private float temperature;
private float distance;
SensorData(float temperature, float distance) {
this.temperature = temperature;
this.distance = distance;
}
float getTemperature() {
return this.temperature;
}
float getDistance() {
return this.distance;
}
}
我不断收到以下消息:
The nested type SensorData cannot hide an enclosing type
上下文是一个处理项目,并且 SensorData 类被用作同一项目文件夹中的草图对象。