inside the While-loop , why the first print statement ( which asks the user to enter a number ) is skipped in the first time? I think It's because I don't understand how hasNextInt() method works , I tried though and read about It but really didn't go far.

the easiest solution is to put one print statement outside the loop , I tried it and it worked, but I just wanna know why this statement is skipped in the first Iteration.

```
Scanner scanner = new Scanner(System.in);
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        int number;
        while(scanner.hasNextInt()) {
            System.out.print("Enter a number: ");
            number = scanner.nextInt();
            scanner.nextLine();
            max = Math.max(max,number);
            min = Math.min(min,number);
        }

        System.out.println("Max number is "+max);
        System.out.println("Min number is "+min);
        scanner.close();

```