Get Available Processors - Java Native OS

Java examples for Native OS:Environment

Description

Get Available Processors

Demo Code

public class Main {

  public static void main(String args[]) {
    Runtime runtime = Runtime.getRuntime();

    int numberOfProcessors = runtime.availableProcessors();

    System.out.println(numberOfProcessors + " processor available to JVM");
  }//from   w ww .  jav  a 2  s  .c  om
}

Result


Related Tutorials