Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-20-2009, 01:36 AM
Member
 
Join Date: Aug 2009
Posts: 9
Rep Power: 0
anilanar is on a distinguished road
Default [SOLVED] Missing Return Statement error
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.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 08-20-2009, 01:56 AM
Senior Member
 
Join Date: Sep 2008
Posts: 564
Rep Power: 2
emceenugget is on a distinguished road
Default
yeah, that's pretty odd. are you using sun's jdk to compile?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-20-2009, 02:02 AM
Member
 
Join Date: Aug 2009
Posts: 9
Rep Power: 0
anilanar is on a distinguished road
Default
Sorry, It was my fault, the line compiler was pointing at was for another class
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert statement return problem in ibatis dheerajsea123 Database 0 06-20-2009 02:01 PM
[SOLVED] Why does the compiler return "not a statement" for this method body please? trueblue New To Java 3 05-25-2009 09:50 PM
problem while using return statement shaluchandran New To Java 10 12-12-2008 07:29 PM
there is no return statement gabriel New To Java 17 12-03-2008 05:55 PM
[SOLVED] return statement Nakira New To Java 8 11-13-2008 12:00 AM


All times are GMT +2. The time now is 12:08 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org