Breaking while loop in Java

import java.util.Scanner;

class TestingBreakWhileLoop {
public static void main(String[] args) {
int i;

Scanner input = new Scanner(System.in);

while (true) {
System.out.println(“Input an integer for this test program”);
i = input.nextInt();

if (i == 0) {
break;
}
System.out.println(“You have entered …  ” + i);
}
}
}