Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Arrays;
import java.util.Collections;

import java.util.List;

public class Main {

    public static List<Thread> getGroupThreads(ThreadGroup threadGroup) {
        if (threadGroup == null) {
            return Collections.emptyList();
        }

        Thread[] threadArray = new Thread[threadGroup.activeCount() * 2];
        threadGroup.enumerate(threadArray);
        return Arrays.asList(threadArray);
    }
}