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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does @override mean in java?

556


Do I need to install jre if I have jdk?

547


Can java program run without jdk?

592


I am trying to create a new universal user group. Why can't i? : java security

604


When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?

586






What is stateless object in java?

579


How do I open my java console?

567


Does ms edge support java?

545


can a program use more than one command-line argument?

541


when i send the request to the JSP page it will print as it is and why? and how to solve this problem please inform me that solution

1521


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

581


What is phantom memory?

620


I have deployed a .war file in my application server comprising of struts and hibernate.If i want to change the "dialect" property of hibernate cfg file how can i change(I have only .war file)... Thanks in advance

1506


Is openjdk the same as jdk?

587


What is a delimiter in java?

562