Example using Runtime

Here we can see the example with some method of Runtime.


package com.javaforcast;

public class ExampleRuntime {
    public static void main(String[] agrs)throws Exception
    {
         Runtime rt =Runtime.getRuntime();
         System.out.println(rt.availableProcessors());
         System.out.println(rt.totalMemory());
         System.out.println(rt.maxMemory());
         System.out.println(rt.freeMemory());
    }

}

Output:
2
16252928
259522560
15965080

0 comments :

Post a Comment