r/programmingchallenges • u/Crazo7924 • Nov 02 '19
[Java] [probably OC] Print a string infinite times without the usage of loops. Pure Java code only.
No assembly stuff. Goto doesn't exist :P
Edit: no recursion
4
Upvotes
2
u/plexithron Nov 02 '19
How about using a recursive method?
6
u/DPErny Nov 02 '19
I don't understand what this is asking. If you're doing something indefinitely, at some point, you're either using recursion or iteration. Just because you can't see that iteration, maybe because it's buried in a library somewhere, doesn't mean it's not there. I feel like you've probably come up with a clever way to do this and you're challenging other people to see if they can also come up with it, so I'm interested in your solution.
4
u/Sajficka Nov 02 '19
Use scheduled threadpool
1
u/MCRusher Nov 17 '19
With indirect recursion.
Maybe spawning a thread which spawns a thread, etc. might not count as recursion?