Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Iterator;

import java.util.Set;

public class Main {
    public static int[] integerSetToInt(Set<Integer> integerSet) {
        if (integerSet == null)
            return new int[0];

        int i = 0;
        int[] intArrays = new int[integerSet.size()];
        for (Iterator<Integer> Itr = integerSet.iterator(); Itr.hasNext();) {
            intArrays[i] = Itr.next().intValue();
            i++;
        }
        return intArrays;
    }
}