Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**
     * Find out how many cores are available to the JVM.
     * */
    public static int getCoreCount() {
        int retval = Runtime.getRuntime().availableProcessors();
        if (retval > 4) {
            retval = 4;
        }
        return retval;
    }
}