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 cookie in java?
In an htm form i have a button which makes us to open another page in 15sec.how will you do that?
Are streams faster than for loops?
What is xml file in java?
What is a bean class?
In which language eclipse is developed?
What is meant by java se?
Is java an api?
What is native class in java?
Describe life cycle of thread?
Are jvm’s platform independent?
Are the actual permissions for the application defined at run-time or compile-time? : java security