Java - missing return statement..

Discussion in 'Java' started by sweety5236, Apr 9, 2008.

  1. sweety5236

    sweety5236

    Joined:
    Apr 9, 2008
    Messages:
    1
    Hi everyone..i'm working on a piece of code..
    can anyone tell me what's wrong with the code..

    public int move() {
    Random generator = new Random();
    int num = 1+generator.nextInt(9);

    if(thisBoard.getplayer(num) == Board.NO_ONE){
    return num;
    }
    }

    Thanks.
     
    sweety5236, Apr 9, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    4
    Views:
    20,720
    Shishir19
    Mar 19, 2007
  2. Seong-Kook Shin
    Replies:
    1
    Views:
    521
    Richard Bos
    Jun 18, 2004
  3. Gary Herron
    Replies:
    2
    Views:
    697
    Bruno Desthuilliers
    Jul 4, 2006
  4. Greenhorn
    Replies:
    15
    Views:
    883
    Keith Thompson
    Mar 6, 2005
  5. macracan
    Replies:
    3
    Views:
    623
    Jack Klein
    Feb 8, 2008
Loading...

Share This Page