I have a static method, that deletes a ftp tree, so it needs to call itself recursively if it finds a sub dir, would it cause confusion because it's static ?
Edit : I didn't test before my post because if it causes a problem, I might have deleted extra files outside my test target, didn't want to risk it.
No, it wouldn't, static methods can be used in recursive calls.
nope. you're good. I apparently have to write at least 30 chars for this post to be accepted.
no. why would there be a problem?
It'll only be a problem if your recursive method doesn't have a good stopping condition. You'll find out quickly if that's the case - you'll get an OutOfMemoryError when the stack frames pile up on top of each other.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With