Click here to watch in Youtube :
https://www.youtube.com/watch?v=V-Ph3vkW6io&list=UUhwKlOVR041tngjerWxVccw
RuntimeDemo.java
Click the below link to download the code:https://www.youtube.com/watch?v=V-Ph3vkW6io&list=UUhwKlOVR041tngjerWxVccw
RuntimeDemo.java
public class RuntimeDemo
{
public static void main(String[] args)
{
/*
* Returns the runtime object associated with the
* current Java application.
*/
Runtime runtime = Runtime.getRuntime();
/*
* Returns: the maximum number of processors
* available to the virtual machine; never smaller
* than one
*/
int availableProcessors = runtime.availableProcessors();
System.out.println("availableProcessors = "+availableProcessors);
}
}
OutputavailableProcessors = 4

No comments:
Post a Comment