Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Can I run seam in a j2ee environment?

958


What is a thin client?

1020


What is jetty in java?

984


whay java does not support bass by reference

2932


Is j2ee a framework?

923


How do you make a class immutable in java?

843


What is a java applet?

947


What is commit?

1043


Why java is oop language?

920


What is the difference between session bean and entity bean ?

907


What is jaxr client?

985


What is java technology stack?

882


explain the technologies that j2ee platform provides for developing components.

860


to update a batch in a table in jdbc which method of statement object is used

2079


What do you understand by j2ee?

941