1

I'm working out an exercise for a generalized programming course. This specific problem is in Java, which I am not familiar with. I can infer most of it but there's one part I don't know the name of to research. Here's the code (and yes, it's intentionally very obtuse for learning purposes):

class Reuse {
    Reuse Reuse(Reuse Reuse) {
        Reuse:
            for (;;) {
                if (Reuse.Reuse(Reuse) == Reuse)
                    break Reuse;
            }
            return Reuse;
        }
}

The third line (Reuse:) is what I don't understand. What's the name of that part of the function?

Brandon Lyons
  • 473
  • 3
  • 10

1 Answers1

2

That's a label.

Labels are used with break and continue statements to make code execution jump to a specific line.

Jonathan Kuhl
  • 699
  • 9
  • 23