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 j2ee product provider?
What is comment?
What are the components of J2EE application?
What is basic authentication?
How will you explain load() and get() methods?
Is java part of oracle?
What is repaint in java?
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?
Is string an object in java?
Is j2ee a programming language?
What is jta and jts?
What are types of j2ee clients?
What is difference between javac and java?
What are the components of awt in java?
Define orm and its working in j2ee?