There is no goto
in Java as of yet. It's a reserved word, in case there ends up being the need for it, but as far as I know, they haven't used it yet.
Probable equivalent code:
case 2:
float sub1 = 0.0;
do {
System.out.println("Enter the marks (in 100):");
System.out.println("Subject 1:");
sub1 = Float.parseFloat(br.readLne());
} while (sub1 >= 101);
... rest of the code ...
Note, this code would be equivalent for this particular situation. There's no universal replacement for goto
; if there were, they'd just call it goto
and be done with it. Each case will be different, and the replacement will depend entirely on how the goto
would have been used.