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


Please Help Members By Posting Answers For Below Questions

How many types of objects are there in java?

467


explain the technologies that j2ee platform provides for developing components.

484


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?

1559


Why java is not 100% object oriented language?

496


What is java api for xml processing (jaxp)?

556






How will you explain cdata?

559


What is java developer job description?

480


What are the different java technologies?

492


Explain the j2ee tiers.

480


What is jaxr client?

527


What is a thin client?

577


What are the differences between Ear, Jar and War files? Under what circumstances should we use each one?

527


What is basic authentication?

549


What is the latest framework in java?

475


Where can I find java developers?

516