1. import java.util.Scanner;
  2.  
  3. public class Goto {
  4.  
  5.     public static void main(final String[] args) {
  6.         Scanner scan = new Scanner(System.in);
  7.         int j = 1;
  8.  
  9.         test: if (j != 0) {
  10.             loop: for (int i = 0; i < 4; i++) {
  11.                 System.out.println("Enter a value");
  12.                 int input = scan.nextInt();
  13.  
  14.                 if (input < 0) {
  15.                     System.out.println("Enter 0 to quit");
  16.                     j = scan.nextInt();
  17.                     break test;
  18.                 } else {
  19.                     continue loop;
  20.                 }
  21.             }
  22.         }
  23.     }
  24. }