public class1 foo ( class1 t)
{
    if ( object == null ) return t;
    else foo(t.childObject);
}
Java keeps telling me that there is no return statement. I can understand what is wrong here, but I cannot fix it without removing the recursion, which I really need. Is there any way to bypass this error?
                        
You need a
returnin the else case.