suppose we have one String s="india is my country"; now we
get the o/p "like country my is India". what is the logic?
Answers were Sorted based on User's Feedback
Answer / neeraj03
String[] x1=s.split(" ");
for( int x2=x1.length-1; x2 >= 0; x2-- )
{
System.out.print( x1[x2] );
System.out.print( " ");
}
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / naresh
String s="india is my country";
String[] news=s.split(" ");
StringBuffer sb="";
for(int i=0;i<s.length;i++){
sb.append(s[i]);
sb.append(" ");
}
Is This Answer Correct ? | 1 Yes | 0 No |
What is profile in java?
What is gui in java with examples?
Name primitive java types.
What is reflection in java?
Which is best framework in java?
How can I protect myself? : java security
What is the meaning of the words public, static and void?
when Can an object reference be cast to an interface reference?
What is jndi datasource in java?
Is jpa a framework?
What is the meaning of loosely coupled in java?
How do I install java on windows?