Get Number of Available Processors



To display the number of processors available to a certain Java Virtual Machine there is a method of the Runtime class called availableProcessors().
To get an instance of the Runtime class we have to call the static method getRuntime(). The example below illustrates how to go about displaying the number of processors.

On the machine where this example was tested the output looked like this:







Search for more Java info on this site here:
Custom Search


Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">