从理论上讲,如果类“sensorFinal”无法访问整数“value”,“sensorFinal”类中的函数“absSensor”如何能够调用“proximitySensor”类中的函数“proximitySensorAdjusted”?
是否有一种标准方法可以调用对数据访问受限的函数,或者是否有解决方法?提前致谢!
public class proximitySensor
{
double adjustment = 5;
public double proximitySensorAdjusted(int value)
{
double finalValue = value + adjustment;
return finalValue;
}
}
public class sensorFinal
{
public double absSensor()
{
proximitySensor sensorValue = new proximitySensor();
sensorValue.proximitySensorAdjusted( ??? )
}
}
动漫人物
慕码人8056858
慕田峪7331174
相关分类