C
goto
- Must be defined within a function
- Each label in one function must have a unique name. It cannot be a reserved C keyword
- C has a separate namespace for labels, so you can use the same name for a variable and a label
- Must be followed by a statement. We call it a `labeled statement`
- Has function scope, Therefore the label:
- Must have a unique name within that function
- Is not accessible outside the function, where it was defined
Java
goto is a reserved word in Java. Java supports label, the only place where a label is useful in Java is right before nested loop statements, label name can be specified with break and continue
Go