java progaram

Ads

 
 

Share on Google+Share on Google+

gaayatri
java progaram
1 Answer(s)      7 years ago
Posted in : Java Beginners
Ads
View Answers

October 8, 2009 at 11:58 AM


Hi Friend,

Try the following code:

import java.util.*;

class StringProgram{
public static void main(String []args){
System.out.println("Enter any string");
Scanner input=new Scanner(System.in);
String st=input.nextLine();
int len=st.length();
char ch[]=st.toCharArray();
String str="";
System.out.println("******Reversed String******");
for(int i=len-1;i>=0;i--){
System.out.print(ch[i]);
}
System.out.println();
System.out.println("******Sorted String******");
Arrays.sort(ch);
String s=new String(ch);
System.out.println(s);
}
}

Thanks

Ads









Related Tutorials/Questions & Answers:
java progaram - Java Beginners
java progaram  write a java program to read these strings apple orange banana and display the frist character of each string then next characterof each so on? this is urgent send the source soon  Hi Friend, Try
java progaram - Java Beginners
java progaram  write a java program to read 1 to n numbers and display the odd and even numbers of the list separately   Hi Friend, Try the following code: import java.util.*; class OddEvenList{ public static
Advertisements
java progaram - Java Beginners
java progaram  write a java program to read a string without using string function reverse the string and also give the alphabetical order of the string  Hi Friend, Try the following code: import java.util.
Solve Program - Java Beginners
Solve Program  Write a progaram in java to display all odd number from 1 to 100   hi use this code package rajanikant.code.sep_2008...://www.roseindia.net/java/ Thanks
java
java  diff bt core java and java
java
java  what is java
Java
Java   Whether Java is pure object oriented Language
java
java  different between java & core java
java
java  explain technologies are used in java now days and structure java
java
java   why iterator in java if we for loop
JAVA
JAVA  how the name came for java language as "JAVA
java
java  what is java reflection
java
java  is java open source
java
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
java
java  write a java program using filenotfoundexception
Java
Java  how to draw class diagrams in java
java
java   difference between class and interface
java
java  why multiple inheritance is not possible in java
java
java  explain object oriented concept in java
java
java  is java purely object oriented language
Java
Java   Whether Java is Programming Language or it is SOftware
java
java  what are JAVA applications development tools
java
java  how use java method
java
java  send me java interview questions
java
java  write a program in java to acess the email
java
java  Write a java code to print "ABABBABCABABBA
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
Tutorials   
Java Spring Hibernate Struts Training What type of programming language is Java? How do beginners learn about Java? ClassNotFoundException HttpRequestInterceptor java.lang.noclassdeffounderror: org/apache/http/httprequest noclassdeffounderror: org/apache/http/client/methods/httpurirequest java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient How do I resolve this Java Class not found exception? httpclient java.lang.NoClassDefFoundError Apache Commons ioutils maven dependency Read/Convert an inputStream to a String What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017

Ads

 
Advertisement null

Ads