为什么从静态类提示时Java不退出循环?

I know this is kinda hard to explain but I will try my best.
I want to display 2 menu then ask user input his/her option from 0-5, where if user enter 0 it will exit.
So I wrote a class with static method/function to get user input because I want to validate range right. example
Classname.getInputThenValidate //using standard Scanner sc = new Scanner(System.in)

然后在我的主要权限中,我做了一个do-while循环,要求提示用户输入2次

int input;
do
{
    input = Classname.getInputThenValidate("press zero", 0, 5); //validate input within 0-5

    System.out.println(input == 0); //return true

    input = Classname.getInputThenValidate("infinity loop", 0, 5); //after press zero it stills enter here

}while (input != 0);

我使用布尔输入检查是否为零,但仍不退出,​​为什么会这样?