how to create a recursive function in Java