Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

simple problem

Options
  • 10-03-2004 2:32pm
    #1
    Closed Accounts Posts: 537 ✭✭✭


    Main.java [379:1] illegal start of expression
    bins = start*;
    ^


    Anyone know how to fix this



    It is within a for loop


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    bins = start * bins; //Assumes that bins is an array of primitive numbers of the same type as start


  • Closed Accounts Posts: 537 ✭✭✭JohnnyBravo


    for (int i =0; i< MaxBin; i++);
    {
    int start = 30/MaxBin;
    bins = start*;
    }
    System.out.println("x" + bins);
    }


    Thats the loop


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Illegal start of expression is usually a good time to cast your eyes to the lines before it. Check you're not missing any semicolons or brackets. If you can't find it, post your code (or the section it's occuring in).

    [Edit: Remove the semicolon after the for() statement. You should also ways have a double on the left hand side of an assignment where division takes place on the RHS. If accuracy isn't important, replace the RHS with '(int)(30/MaxBins)'


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    If your just trying to multiply start by i, remove the square brackets.

    I can't really tell what your trying to do though... Not sure if your trying to multiply by i, or by the value in i's position in bins.


  • Closed Accounts Posts: 537 ✭✭✭JohnnyBravo


    cheers lads that did the trick


  • Advertisement
Advertisement