Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.LinkedList;
import java.util.List;

public class Main {

    public static String[] array_unique(String[] strs) {
        // array_unique
        List<String> list = new LinkedList<String>();
        for (int i = 0; i < strs.length; i++) {
            if (!list.contains(strs[i])) {
                list.add(strs[i]);
            }
        }
        return (String[]) list.toArray(new String[list.size()]);
    }
}