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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I enable java in google chrome?

521


Write a program for the problem: the array of inetegers indicating the marks of the students is given, U have to calculate the percentile of the students aaccording to this rule: the percentile of a student is the %of no of student having marks less then him. For eg: suppose Student Marks A 12 B 60 C 80 D 71 E 30 F 45 percentile of C = 5/5 *100 = 100 (out of 5 students 5 are having marks less then him) percentile of B = 3/5*100 = 60% (out of 5, 3 have markses less then him) percentile of A = 0/5*100 = 0%.

1761


Which class is the superclass of every class?

596


What are java’s rules regarding tabs, spaces and newline characters?

1099


What happens if javac is not recognized?

529






What is a static method?

593


How do I download and install eclipse on windows 10?

517


What is loose coupling in java?

548


What is the difference between ec2 and lambda?

540


What is lambda expression in mvc?

557


What is difference between map and flatmap in java 8?

546


What is hql in java?

566


Explain the reason for each keyword of public static void main(string args[])?

567


I run a web server. Am I at risk? : java security

581


Why there are no global variables in java?

593