class Fibo {
    public static void main(String[] args) {
        Scanner input;

        input = new Scanner(System.in);
        System.out.print("Type in amount of numbers for sequence  -->  ");
        try {
            int N = input.nextInt();
            int x1 = 0, x2 = 1;

            int count = 0;

            while (count < N) {

                System.out.print(x1 + " ");

                int x3 = x2 + x1;
                x1 = x2;
                x2 = x3;
                count = count + 1;
            }


        } catch (Exception e) {  
            System.out.println("Input must be an integer  " + e);
        }
        
    }
}
Fibo.main(null)
Type in amount of numbers for sequence  -->  0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368