wood burning stoves*
The moose likes Beginning Java and the fly likes operator trouble 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 "operator trouble" Watch "operator trouble" New topic
Author

operator trouble

Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
I am getting a "The operator > is undefined for the argument type(s) int, String" error on the if statements using vals.getMinimum and vals.getMaximum. Total is an int. getMinimum and getMaximum return ints. What else do I need to do to make this work?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
From the error message, it really looks like your compiler is convinced that getMaximum() and getMinimum() return ints. Double check this four or five more times. Try deleting all your .class files (not the .java files) to ensure that the compiler is recompiling everything it needs to. Make sure your class path isn't pointing to any other directories that have an old/alternate version of the class that has getMaximum() in it.


"I'm not back." - Bill Harding, Twister
Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
Ok, now I'm more confused. I want getMinimum()/getMaximum() to return ints. vals is a Values object is that what is causing the problem? If not, what would be the problem with total and getMinimum()/getMaximum() both being ints?
Howard Kushner
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 361
Candy,
Presuming that total is an int as you claim, what is the Values type? Can you share the class definition with us?


Howard Kushner<br />IBM Certified Enterprise Developer - WebSphere Studio Application Developer V5.0<br />IBM Certified Advanced System Administrator - WebSphere Application Server V5.0<br />IBM Certified Solution Developer - Web Services with WebSphere Studio V5.1<br /><a href="http://www.amazon.com/exec/obidos/tg/detail/-/1931182108/" target="_blank" rel="nofollow">Developing J2EE Applications with WebSphere Studio</a> my Certification Study Guide for IBM Test 287
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
From the error message, it really looks like your compiler is convinced that getMaximum() and getMinimum() return ints.
Oops, I misspoke here. I mean to say the error message indicates the compiler thinks getMaximum() and getMinimum() return Strings. Not the ints which you want (and which would also make the compiler happy.)
And Howard is correct - check the type of total too. Something is a String when it should be an int.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

The errormessage says, that the second parameter is a String.
You needn't proof this.
Allways read errormessages carefully.
Most people close their eyes when an error occurs.
(And it's always more easy to find the errors from the others.)


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: operator trouble
 
Similar Threads
making a class visible
Cutting off a string after certain amount
How to make jTextField 's input unscrollable?
Restricting characters in a JTextField
Custom Formats JFormattedTextField