Eclipse has had that feature (code folding) for a while, but I don't know how far back it goes. However, it is a configurable feature; it can be turned off. If you do not seem to have that feature and are using a relatively recent version, you should check your editor options to see if if has been turned off.
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
I apologize. As Peter points out, I've similarly checked the version(s) of Eclipse that I use, and folding loops is not supported. I also use Geany, often at the same time as I'm using Eclipse so that I can have another editor open at the same time, and it's much more generous with the types of cold folding it allows, including loops. I was confused.
subject: I use eclipse IDE and having a java code which has a if loop