Write a program to print Reverse words from string

 

Public static void main ( String args [] )

{

String s="Selenium with java";

Char words[]=s.split(" ");

StringBuffer reverse=new Stringbuffer ();

For(String word:words)

{

StringBuffer sb=new StringBuffer(word);

Sb.append(sb.reverse().append(" "));

}

System.out.println(sb.toString());


}

Comments

Popular posts from this blog

Write a program to print all link present on google page || selenium code