Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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);
    }
}
Comment

sort a string array java

String[] myArray = {"JavaFX", "HBase", "OpenCV", "Java", "Hadoop","Neo4j"};
Arrays.sort(myArray);
System.out.println(Arrays.toString(myArray));
Comment

PREVIOUS NEXT
Code Example
Java :: java Program for Sum of the digits of a given number 
Java :: testing the web layer without authentication spring 
Java :: java constructor chaining 
Java :: abs in java 
Java :: mongodb java find all documents 
Java :: datatypes in java 
Java :: change string to char array 
Java :: android studio change launcher icon 
Java :: jdbc interface 
Java :: string to int 
Java :: file append in java 
Java :: exception in thread "main" java.lang.indexoutofboundsexception: index 1 out of bounds for length 1 
Java :: how to import class from another file in java 
Java :: java string to integer 
Java :: how to center a window in java 
Java :: java protected private public 
Java :: java instance of a class 
Java :: getcolor deprecated android 
Java :: how to increase the size of array in java 
Java :: mapping over a list of promises in javaascript 
Java :: how to use arrays java 
Java :: java throw an exception 
Java :: how to get 2 decimal places in java 
Java :: error: package android.support.v7.app does not exist 
Java :: assert multiple junit 
Java :: Java alt + f4 
Java :: how to convert kilometers to miles in java 
Java :: get list data in java 
Java :: java convert am pm to 24 hour 
Java :: Area of a Circle in Java Programming 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =