Click to See Complete Forum and Search --> : Returning an Object from a find()....


webrep
August 19th, 1999, 09:47 AM
Hi All:

This code compiled fine in Java 1.0; when porting it to the
Java 1.1 compiler - the compiler is complaining that this
find() method needs a return. I've tried returning multiple objects
all to no avail & would greatly appreciate some expert feedback
here if possible. Thanks in advance:

public Object find(int i, String s, List li

unicman
August 22nd, 1999, 10:58 AM
R u getting error which is similar to...
'method find(..) should return a value'.

Actually from JAVA1.1 onwards it is a must that if a method declares that it will return something, it should return the value in any case.

In ur code the u haven't returned anything if the method gets till the last statement of ur method.

- UnicMan