Java program to shuffle words

Java program to shuffle words
e.g:-
Input: hello dear
output: dear hello

Input: hello dear how are you ?
output: dear how are you ? hello

Two approaches
  1. Using String class
  2. Using String Buffer class


String class
    by using charAt() and concatenation+


StringBuffer class
   by using charAt(), append() and delete() 
   click here for code............

Comments