It's because you don't specify what to return after the for-loop completes. And if fieldname.length() is zero, then the body of the loop will never be executed, so you need to specify what to return in that case.
As the code is written, you don't need the for-loop at all, since you do the exact same
test (see if the fieldname variable contains the string "0123456789") every time through the loop. And anyway, if the loop body is executed even once, you're going to return either true or false on the first iteration, so there's no point in looping.
However from the name of the method I guess that isn't the test you meant to make. It looks to me as if you are trying to compare each character of a string to see if it's a digit. If all of them are digits, then you want to return true. If any of them are not digits, then you want to return false.
That means that you want to return false immediately when you see a non-digit. I.e. inside the loop. But you want to return true only after you have looked at all the characters and ensured that they are digits. I.e. after the loop completes.
You also need to fix your "is this a digit" check. First, it should look at each individual character of the string, not at the whole string. Second, seeing if "0123456789" is in something is the reverse of what you really want to test.