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?
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
Joined: Mar 17, 2003
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?
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
Joined: Jan 30, 2000
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.
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.)