Skip to content

Tag: scope

Eclipse IDE Scope Highlighting?

When I first learned Java, I was using an IDE called “BlueJ.” It had this feature called “Scope Highlighting” which made it very easy to read blocks of code. Now I’ve moved on from BlueJ and began using Eclipse. I’m currently in the process of customizing Eclipse to my liking and would like this Scope Highlighting feature inside Eclipse. I’ve

Scope of do-while loop?

In Java, the body of a do-while loop and the loop condition do not belong to the same scope. So the following code won’t compile: But this code does make sense to me. Also, I cannot find any pitfalls if the body and the condition are in the same scope; since the body will always get executed, and Java does