title: Keep getting error: '.class' expected line 40
body: <pre><code>import java.util.*;
  
  public class Lab04B {
      public static String toMeters (int unitNumber) {
          String value;
          switch (unitNumber) {
              case 1:
                  value = "Meter";
              break;
              case 2:
                  value = "Nautical mile";
              break;
              case 3:
                  value = "Furlong";
              break;
              case 4: 
                  value = "Mil";
              break;
              case 5:
                  value = "Rod";
              break;
              case 6:
                  value = "Vershok";
              break;
              case 7:
                  value = "Sheppey";
              break;
              case 8:
                  return 1.702;
              default:
                  return -1;
          }
  
          {
      public static double fromMeters (int unitNumber)
      {
          switch (unitNumber)
          {
              case 1:
                  return 1;
  
              case 2:
                  return 1/1852.0;    
  
              case 3:
                  return 1/201.168;
  
              case 4: 
                  return 1/0.0254;
  
              case 5:
                  return 1/5.029;
  
              case 6:
                  return 1/0.04445;
  
              case 7:
                  return 1/1408.0;
  
              case 8:
                  return 1/1.702;
  
              default:
                  return -1;
          }   
              {
      public static String getUnitName (int unitNumber)
      {
          String value;
          switch (unitNumber)
          {
              case 1:
                  value = "Meter";
  
  
              case 2:
                  value = "Nautical mile";
  
              case 3:
                  value = "Furlong";
  
  
              case 4: 
                  value = "Mil";
  
  
              case 5:
                  value = "Rod";
  
  
              case 6:
                  value = "Vershok";
  
  
              case 7:
                  value = "Sheppey";
  
  
              case 8:
                  value = "Smoot";
  
  
              default:
                  value = "faulty input";
  
          } 
          {
              public static void main (String[] args)
  
                  Scanner input = new Scanner (System.in);
  
                  System.out.println("Converting Measurements");
                  System.out.println("By: Ashleigh Pacewicz");
                  System.out.println("1.\tMeter");
                  System.out.println("2.\tNautical Mile");
                  System.out.println("3.\tFurlong");
                  System.out.println("4.\tMil");
                  System.out.println("5.\tRod");
                  System.out.println("6.\tVershok");
                  System.out.println("7.\tSheppey");
                  System.out.println("8.\tSmoot");
                  System.out.println("From what unit would you like to convert? ");
                  int = input.nextInt();
                  System.out.println("To what unit would you like to convert? ");
                  int = input.nextInt();
                  System.out.print("What measurement would you like to convert? ");
                  double = input.nextDouble();
          }
      }
  }
  </code></pre>
  
  <p>I am just learning how to code. I'm trying to write a program to convert meters but I keep receiving error on line 40 and line 63 and line 96. Error:</p>
  
  <blockquote>
    <p>'.class' expected.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>