There is no goto in Java. However, the language has labelled break statements that allow several levels of nested loops to be terminated in one go. For example:
outer_loop: // this is a loop label for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (a[i][j] == k){ break outer_loop; // exits the outer for loop } } }