Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JOption problems

 
jamie keene
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had to convert a code to JOption and can't get it to compile


the error code reads

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the returned type of the method you are calling here ? Did you check the API ?
 
jamie keene
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so now I am getting a new error


now it is saying loss of precision on miles parsedouble
 
Rob Camick
Ranch Hand
Posts: 2584
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at how you define your variables:



And look at how you try to parse them:



Does the parse method match the variable type?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You declared miles to be an int and weight to be a double. It looks like you're not calling parseInt/parseDouble for the right variables.

(ps: avoid calling your variables like xxxString. It's useless to put their type in their name)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic