I've created a small code that asks the user to input any word, then it will reverse it. I can't figure out how to reverse it so help is appreciated.
Here is my code:
package Test;
import java.util.Scanner;
public class TestMain {
public static void main(String[]args){
String word = getWord();
char[]wordArray;
wordArray = word.toCharArray();
System.out.print("NORMAL WORD: " + word + "\n");
System.out.print("REVERSE WORD: ");
}
public static String getWord(){
Scanner hold = new Scanner(System.in);
String word;
System.out.print("Enter a word:");
word = hold.nextLine();
return word;
}
}