Answers for "sort array string java"

0

sort string 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);
    }
}
Posted by: Guest on April-18-2021
1

sort a string array java

String[] myArray = {"JavaFX", "HBase", "OpenCV", "Java", "Hadoop","Neo4j"};
Arrays.sort(myArray);
System.out.println(Arrays.toString(myArray));
Posted by: Guest on September-29-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language