Java 转换测量程序。如果声明说;预期?

Java 转换测量程序。如果声明说;预期?,java,Java,请有人看一下我的密码。它不会编译,因为它说;此处应为-}elseif(convert==2){ 我不明白为什么,我对这个很陌生。 问候 //用户选择要转换的测量单位,输入数字并显示转换 class Convertweight { public static void main (String [] args) { Scanner input = new Scanner(System.in); //Declare variables double

请有人看一下我的密码。它不会编译,因为它说;此处应为-}elseif(convert==2){

我不明白为什么,我对这个很陌生。 问候

//用户选择要转换的测量单位,输入数字并显示转换

class Convertweight
{
  public static void main (String [] args)
  {
    Scanner input = new Scanner(System.in);

        //Declare variables
        double feet=0.0, temp=0.0, weight=0.0, metres=0.0, f=0.0, stone=0.0, convert=0.0;


        //choices of measurment to convert
        System.out.println("Please choose and enter either 1,2 or 3 from the measurements below.");
        System.out.println("1. Feet to metres");
        System.out.println("2. C temp to F temp");
        System.out.println("3. KG to stone");
        convert=input.nextDouble();

        //convert measurment if option 1 is chosen.
     if (convert == 1) {
        System.out.println("Enter measurement");
        feet=input.nextDouble();
        metres=feet/3.28;
        System.out.println(metres + "m"); 

        //convert temperature if option 2 is chosen.
     } elseif (convert == 2){
            System.out.println("Enter temperature in celsius");
            temp=input.nextDouble();
            F=C*1.8+32;
            System.out.println(F + "f");

         //convert weight if option 3 is chosen.  
     } elseif (convert == 3){
            System.out.println("Enter weight in KG");
            weight=input.nextDouble();
            stone=weight/6.35029318;
            System.out.println(stone+"st");


    }

else如果
格式正确,则
elseif
将导致编译错误。请检查以获得更好的理解。

elseif
应该是
,否则如果
在此处发布代码时是打字错误还是这是您的真实代码?
elseif
是PHP语法,而不是Java。