How many ways can one write an infinite loop ?
Personally I would recommend following ways to implement infinite loop in Java but their can be other ways like calling a method recursively , though I never tested that.
- while (true)
- for (;;) { }
- while (true)
- for (;;) { }