Results 1 to 3 of 3
  1. #1
    anilanar is offline Member
    Join Date
    Aug 2009
    Posts
    9
    Rep Power
    0

    Default [SOLVED] Missing Return Statement error

    Java Code:
    public void shuffle() {
          for ( int i = deck.length-1; i > 0; i-- ) {
             int rand = (int)(Math.random()*(i+1));
             Card temp = deck[i];
             deck[i] = deck[rand];
             deck[rand] = temp;
          }
          cardsUsed = 0;
          
       }
    This code is in the "Deck" class, and I get a missing return statement error for this method. (I guess they're called methods?) How come I get that error for a void type? Can someone help me?
    Last edited by anilanar; 08-20-2009 at 02:05 AM.

  2. #2
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    yeah, that's pretty odd. are you using sun's jdk to compile?

  3. #3
    anilanar is offline Member
    Join Date
    Aug 2009
    Posts
    9
    Rep Power
    0

    Default

    Sorry, It was my fault, the line compiler was pointing at was for another class :rolleyes:

Similar Threads

  1. insert statement return problem in ibatis
    By dheerajsea123 in forum JDBC
    Replies: 1
    Last Post: 05-20-2010, 11:22 AM
  2. Replies: 3
    Last Post: 05-25-2009, 09:50 PM
  3. problem while using return statement
    By shaluchandran in forum New To Java
    Replies: 10
    Last Post: 12-12-2008, 07:29 PM
  4. there is no return statement
    By gabriel in forum New To Java
    Replies: 17
    Last Post: 12-03-2008, 05:55 PM
  5. [SOLVED] return statement
    By Nakira in forum New To Java
    Replies: 8
    Last Post: 11-13-2008, 12:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •