• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

missing return statement?

 
Asha Dore
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I'm getting a missing return statement error at line 87 and I can't figure out what I'm missing :/
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

you are commenting wrongly here. check whether every open { tag has valid closing } tag/brace
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What will be returned from legalHex when valid is true and str.length() is 0? Hint: the loop body will not be executed.
 
Asha Dore
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops no that was a copy/paste error. I fixed that. The only error I'm getting on the compiler is the missing return statement on line 80. Sorry. Wrote the wrong line.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the method legalHex(), at the if(valid), is valid is true and the loop doesn't run, because the condition is false, then nothing is returned. Which is illegal.
 
Asha Dore
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




thank you all for your help. Everything is compiling and running the way it is supposed to, except that decimalValue is supposed to be returning the values set in hexValue (I think - my professor's wording is v difficult to understand), but it is not returning the right numbers. I think the issue is my arithmetic. Anyone have any thoughts? Thanks so much!
 
fred rosenberger
lowercase baba
Bartender
Posts: 12186
34
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a specific example of what is wrong? I've tried a few numbers, and it seems to work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic