r/javahelp • • Apr 01 '22

help with java code

hi i’m trying to write code for an assignment and a part of my code (i < drywet.length && i < wetwet.length) are underlined red. it says “the operator < is undefined for the argument type(s) int, Object”

can someone please explain what i need to do to fix it?

0 Upvotes

14 comments sorted by

View all comments

1

u/clinical27 Apr 02 '22

I can't say for sure as I don't have all the info of what these variables are, but I would assume 'i' is some sort of counter so it is probably an int, so is drywet or wetwet an object? If so, your length field may not be defined properly to return a value that can be compared.