Processor count
In this chapter you will learn:
Processor count
int availableProcessors()
from Runtime
class
returns the number of processors available to the Java virtual machine.
public class Main {
public static void main(String[] args) {
Runtime runtime = Runtime.getRuntime();
//ja v a 2 s . c o m
System.out.println(runtime.availableProcessors());
}
}
The output:
Next chapter...
What you will learn in the next chapter:
Home » Java Tutorial » Utility Classes