什么是do while循环
int i = 0;
do {
System.out.println(i);
i++;
} while (i <= 100);
具体使用场景
int i;
Scanner scanner = new Scanner(System.in);
do {
System.out.print("请输入一个整数,如果为负数则结束循环:");
i = scanner.nextInt();
} while (i >= 0);
System.out.println("循环结束");