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 cache in java?
What is injection in java?
What is war file in java?
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?
Write a class which checks whether a given number is prime or not. Write another class to implement the behavior of previous class and print the series of twin prime number upto a given range.
Is jar an executable?
What is meant by rest api in java?
What is the difference between lambdas and delegates?
What is stateless object in java?
What can open a jar file?
What is jpa used for?
What is ui framework in java?