Back to posts
1 min read

Looping without using loop in Java

How to print your name 100 times without using loop and single line of code in Java

Looping without using loop in Java

The title is little crazy, "looping without using loop in Java" but it can be done not only in Java but also in many programming languages. The main point is knowing the syntax where and how to use(code) them effectively.

If someone asks you to print your name 100 times in Java, do like a pro.


Avoid using loop, don't do like that if it's not necessary.


Using String_prototype.replaceAll, it works but it's not a good way to do because it's replacing all of 'a' with 'a' 100 times and printing names by replacing all of 'a' with 'Name'. 


Do like a pro!