434,847 Members | 2,296 Online
Need help? Post your question and get tips & solutions from a community of 434,847 IT Pros & Developers. It's quick & easy.

# illegal start of type and identifier error

 P: 1 I'm getting these 2 errors and haven't got a clue whats causing them please java 43: illegal start of type for (i=0;i< Number_of_squares; i++) java 215 identifier expected } heres the whole code Expand|Select|Wrap|Line Numbers import java.util.*;   public class areaCalculation3 {     // Set-up data input        Scanner data_input = new Scanner(System.in);      public static double valid_data(String input_message)  {      Scanner data_input = new Scanner(System.in);      boolean valid_data = false;      double data = 0;        do      {          System.out.print(input_message);            try          {              data = data_input.nextDouble();              valid_data = true;          }          catch (InputMismatchException e)          {      // Remove invalid data      data_input.next();      // Output error message      System.out.println("Invalid input, please enter a valid number.");          }        } while (! valid_data);        return data;      }        //method for the area of the square       public static void area_of_square(String area);     // Declare variables              double Length, Number_of_squares, Increment, Area, value_of_increment, i;              String area;           for (i=0;i< Number_of_squares; i++)          {              Area = Length * Length;                System.out.printf("%nLength of square: %f", Length);              System.out.printf(", Area of square: %f", Area);                Length = Length + Increment;          }             {             Scanner data_input = new Scanner(System.in);                // Declare variables              double Length, Number_of_squares, Increment, Area, i;              string area;               Length = valid_data("Please enter the length: ");                Number_of_squares = valid_data("Please enter the number of triangles");                Increment = valid_data("Please enter the increment: ");                for (i=0;i