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 many types of objects are there in java?
explain the technologies that j2ee platform provides for developing components.
when i m calling java for web browser . so browser it's not support. show error in browser: internal error occur. java.lang.NoClassDefFoundError. will you give me solution why it's not starting browser.? is there any consult with .net framework2.0?
Why java is not 100% object oriented language?
What is java api for xml processing (jaxp)?
How will you explain cdata?
What is java developer job description?
What are the different java technologies?
Explain the j2ee tiers.
What is jaxr client?
What is a thin client?
What are the differences between Ear, Jar and War files? Under what circumstances should we use each one?
What is basic authentication?
What is the latest framework in java?
Where can I find java developers?