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 conversational state?
What is context root?
What are the four components of j2ee application?
What is a component in java?
What are the four types of J2EE modules?
What is j2ee stand for?
Is java is fully object oriented?
What are the main components of multi-tier architecture?
to update a batch in a table in jdbc which method of statement object is used
What is event in java?
What is the difference between java and j2ee?
What is Connector architecture?
What is sandbox in java?
What is the best java course?
Why java is called portable language?