O'Reilly logo

Java Garage by Eben Hewitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Determine Number of Processors on the Current Machine

This ability could come in handy if, say, you had some software product you were licensing per processor. You could use this method to help ensure user compliance:

Runtime.getRuntime().availableProcessors();
//returns an int.
//In my case, 1.

Read 1984 again.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required