预期的'';在java中进行简单的算术运算
我不知道具体是什么,但我想这是我写手术的方式预期的'';在java中进行简单的算术运算,java,Java,我不知道具体是什么,但我想这是我写手术的方式 public class temperatureConversion { public static void main( String [] args) { //freezing point constant final int FREEZING_POINT = 32; //fahrenheit input int fahrenheit = 75;
public class temperatureConversion
{
public static void main( String [] args)
{
//freezing point constant
final int FREEZING_POINT = 32;
//fahrenheit input
int fahrenheit = 75;
//Fahrenheit to Celsius conversion
double celsius =(fahrenheit- FREEZING_POINT)9.0/5.0;
错误:';'预期
双摄氏度=(华氏-冰点)9.0/5.0
标记点在9处。如果您缺少一个运算符,我假定您打算进行乘法运算(它不是隐含的)。改变 到
你错过了
*
(介于)
和9.0之间的*
,谢谢。我看了这么久,现在觉得自己很傻
double celsius =(fahrenheit- FREEZING_POINT)9.0/5.0;
double celsius =(fahrenheit- FREEZING_POINT)*9.0/5.0;