File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes JOption problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JOption problems" Watch "JOption problems" New topic
Author

JOption problems

jamie keene
Greenhorn

Joined: Feb 15, 2011
Posts: 28
I had to convert a code to JOption and can't get it to compile


the error code reads

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

What is the returned type of the method you are calling here ? Did you check the API ?


[My Blog]
All roads lead to JavaRanch
jamie keene
Greenhorn

Joined: Feb 15, 2011
Posts: 28
so now I am getting a new error


now it is saying loss of precision on miles parsedouble
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2155
    
    7
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

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)
 
 
subject: JOption problems
 
Similar Threads
completely lost
HELP ME PLEASE!!!
Noob java assigment
Help with GUI assignment.
Need help with variables