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
What is home handle?
Is java a tool?
What is core java and j2ee?
What does java awt stand for?
What is difference between javac and java?
What is a panel java?
Is object a composite data type in java?
Define authorization constraint?
How many types of modules is defined by j2ee specification?
What is actionform?
What do you understand by a thin client?
Why is java called technology?
What is java awt event?
What is front end technology in java?
What do you mean by j2ee module?