Your method does not necessarily return the same variable that it accepts. A method could look like this:
public
String traverseStringArray(int i)
{
String [] names = {"Bob", "Jim", "Craig"};
if (i < names.length())
return names[i];
else
return String fail = "Sorry, there's no one here by that identification number!";
}
If you were assuming when you asked the question that you were returning the value you handed it, I believe you could do that without an error because it would cast for you.
[This message has been edited by Janna Lockhart (edited April 10, 2001).]