The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Re: error: This method must return a result of type int

Also, I might add that there's no need to use the Boolean wrapper class. I think that's only if you needed to either store the Boolean in like a Vector, ArrayList, Set, Map, Tree, or Linked List, or some other type of Collection. Or if you needed to make it turn into a String, like for a TextField, textArea, etc. I can't think of any other uses other than those two I mentioned above. (However, perhaps, I never came across this yet, it might possibly be to use the equals(Object obj) method to check to see if two booleans were equal to each other. However, I believe boolean1 == boolean2 is also valid and preferable. ) You should probably use the primitive boolean.

Re: error: This method must return a result of type int

If it finds it, foundResponse is set to true, but that doesn't matter as the return statement will return a and exit the method if it finds it. If it never gets set to true, it'll go into the if loop happens if it can't find it. The third return statement doesn't make much sense.