Produce the Fibonacci sequence in multiple ways

Fibonacci Using For Loop

import java.util.Scanner;

public class FLoop {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n = in.nextInt();

        int firstTerm = 0, secondTerm = 1;


        System.out.println("Fibonacci Series for the first " + n + " terms:");

        for (int i = 1; i <= n; i++) {
            System.out.print(firstTerm + " ");

            int nextTerm = firstTerm + secondTerm;
            firstTerm = secondTerm;
            secondTerm = nextTerm;
        }

    }
}
FLoop.main(null);
Fibonacci Series for the first 20 terms:
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 

Fibonacci Using While Loop

import java.util.Scanner;

public class WLoop {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int firstTerm = 0, secondTerm = 1, i = 1;

        System.out.println("Fibonacci Series for the first " + n + " terms:");

        while (i <= n) {
            System.out.print(firstTerm + " ");
      
            int nextTerm = firstTerm + secondTerm;
            firstTerm = secondTerm;
            secondTerm = nextTerm;
      
            i++;
        }

    }
}
WLoop.main(null);
Fibonacci Series for the first 20 terms:
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 

Fibonacci Using Recursion

public class Recursion {
    public static void main(String[] args) {
        int lastTerm = 0, nextTerm = 1;

        Scanner sc = new Scanner(System.in);
        int maxTermLength = sc.nextInt();
        System.out.println("How many terms do you want in the Fibonacci Sequence? " + maxTermLength);
        System.out.println("Fibonacci Sequence with " + maxTermLength + " terms.");

        for (int i = 1; i <= maxTermLength; ++i) {
            System.out.print(lastTerm+" ");
            int sum = lastTerm + nextTerm;
            lastTerm = nextTerm;
            nextTerm = sum;
        }

    }
}
Recursion.main(null);
How many terms do you want in the Fibonacci Sequence? 20
Fibonacci Sequence with 20 terms.
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181