write a program, when a statement is entered, it should
display in reverse order.
Ex: Statement is "I am writing program in reverse order".
Output should be like "order reverse in program writing am I".
Answer Posted / vishal
public class Reverse {
public static void main(String[] args) {
String sentence="I am writing program in reverse order";
String[] temp=sentence.split(" ");
for(int i=temp.length-1;i>=0;i--){
System.out.print(temp[i]+" ");
}
}
}
| Is This Answer Correct ? | 16 Yes | 3 No |
Post New Answer View All Answers
Can I run seam in a j2ee environment?
What is a thin client?
What is jetty in java?
whay java does not support bass by reference
Is j2ee a framework?
How do you make a class immutable in java?
What is a java applet?
What is commit?
Why java is oop language?
What is the difference between session bean and entity bean ?
What is jaxr client?
What is java technology stack?
explain the technologies that j2ee platform provides for developing components.
to update a batch in a table in jdbc which method of statement object is used
What do you understand by j2ee?