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
How does j2ee application work?
What is a jbutton in java?
How do I run java?
Is java is fully object oriented?
Which java technology is in demand?
Why awt is used in java?
I’m new to WebLogic Does anyone knows how to Deploy Application using
What are the modules of j2ee?
What is java servlet container?
Describe orm?
Is c++ more secure than java?
What is jaxr client?
Is java part of oracle?
What is frame in java?
What is the name of java compiler?