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 id url?
What is business logic?
What is java 2 platform, standard edition (j2se)?
What is declaration?
What are the components of awt in java?
What is j2ee and j2se?
Is java procedural or object oriented?
Why java is interpreted language?
Is java is a technology?
What is a component in java?
What is ejb container provider?
What is java ee used for?
What is j2ee called now?
What is java 2 platform, enterprise edition (j2ee)?
Is java a high level language?