Reverse words in a line


Given a string reverse the words in that line. public class Answer implements ReverseStringInLineInterface { @Override public String PerformReverseStringInLine(String str) { // WRITE YOUR CODE HERE return ; } public static void main(String [] args) { // write code here to test } } Example1: Input: "Hello World" Output:"World Hello" Example2: Input: "A B C" Output:"C B A"

Answer

No comments:

Post a Comment