MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.util.ArrayList;
import java.util.Collections;

public class MainClass {
    public static void main(String[] av) {

        String[] stringArray = new String[] { "c", "e", "a", "k" };

        ArrayList<String> list = new ArrayList<String>();
        for (String s : stringArray) {
            list.add(s);
        }
        Collections.sort(list, String.CASE_INSENSITIVE_ORDER);

        for (String s : list) {
            System.out.println(s);
        }
    }
}