Can anyone tell me how to write a Java program to reverse a given sentence?

For example, if the input is:

"This is an interview question"

The output must be:

"question interview an is this"

Edit
Report