Write a Java program to reverse the words in a sentence.
public class App {
public static void main(String[] args) throws Exception {
// scanner
Scanner scanner = new Scanner(System.in);
// get the input sentence
// split into words and reverse them
// print the reversed sentence
scanner.close();
}
}
Input a sentence: The quick brown fox
Reversed sentence: xof nworb kciuq ehT