Microsoft Interview Question

Reverse words of a string.

Interview Answer

Anonymous

Jun 29, 2015

import java.util.Stack; public class ReverseSentence{ public static void main(String args[]){ String s = "Hello xyz How are you today"; Stack stack = new Stack(); String [] temp; String delimiter =" "; temp = s.split(delimiter); for( int i=0; i

1