Array is printing each letter of a word on seperate line, how to fix? : Heyo!  So I'm currently working on an assignment for school and the objective is to have the user input n amount of lines and then print them in reverse.

For example:

"Please enter number of lines: "

3

"Please enter the lines: "

Hi

Hey

Howdy

Desired Output:

Howdy

Hey

Hi

My output:

H

o

w

d

y

H

e

y

H

i

I'm not sure what's wrong and I'd really like some help, here is my code:

    import java.util.Scanner;
    public class ReverseOrder {

    public static void main(String[] args) {
    Scanner kb = new Scanner(System.in);
    System.out.println("Please enter the number of lines: ");
    int numberOfLines = kb.nextInt() + 1;

    String inputLines[] = new String[numberOfLines];
    System.out.println("Please enter the lines: ");

    for(int i=0; i<numberOfLines; i++){
    inputLines[i] = kb.nextLine();
    }

    System.out.println("Lines in reverse: ");

    for(int i = numberOfLines - 1 ; i>=0; i--){
    for(int j=0; j<=inputLines[i].length() - 1; j++){
    System.out.println(inputLines[i].charAt(j));
    }
    }
    kb.close();
    }
    }

Thanks so much!