Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

sorting the characters of a string in java

import java.util.Arrays;

public class Test
{
    public static void main(String[] args)
    {
        String original = "edcba";
        char[] chars = original.toCharArray();
        Arrays.sort(chars);
        String sorted = new String(chars);
        System.out.println(sorted);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: intent in fragment android 
Java :: jframe set visibility 
Java :: java jframe example 
Java :: findviewbyid java android 
Java :: android localdatetime 
Java :: Java List Sort Using sort() method 
Java :: enum type spring boot entity 
Java :: java jframe actionlistener 
Java :: spring h2 database example 
Java :: check instance of java 
Java :: how to iterate list of string array in java 
Java :: generate 5 digit random string in java 
Java :: java const 
Java :: math.sin java 
Java :: java divisible by operator 
Java :: empty array java 
Java :: java list contains object with property 
Java :: java terminal colors 
Java :: How to iterate hashmap entries in java 
Java :: Create a button that redirects to another activity in android studio 
Java :: get driver mysql 
Java :: java stream distinct by atribute 
Java :: materialbutton remove shadow xml 
Java :: java download 64-bit 
Java :: java protected 
Java :: Delete end element in string java 
Java :: fhow to find location of java jdk 
Java :: java replace string case insensitive 
Java :: sort an int array java 
Java :: reverse int array java 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =