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 ehcache in java?
Can an application have multiple classes having main method?
Can java program run without jdk?
What is ui framework in java?
How should I format my code? How should I comment my code?
Is jdk an ide?
What are jpa repositories?
What is stateless class in java?
Which is best framework in java?
What is interceptor in java?
Do I really have to type in the programs in the book to try them out?
Can you compile java into exe?