JavaChallenge32
Try to solve the challenge by yourself first.
Most of you might have got the answer correct. For those who did not get it, It’s a code that will print Java Challenge
1000 times without using any loop/recursion but replaceAll
method is using loop only internally. If we count the total number of execution here, it will be —
first replace statement - 1
second replace statement - 10
third replace statement - 100
fourth replace statement - 1000
So the counter count is 1111 in this case but if you try to print anything 1000 times with any loop so that will have 1000 counters only.
Thanks. Let me know if you know any other way to print anything 1000 times without using a loop/recursion.