This tutorial demonstrate how to display total disk capacity of each drive.
This tutorial demonstrate how to display total disk capacity of each drive.This example will demonstrate how to get the total disk space of your drives. The getTotalSpace() method introduced in the Jdk 6 and found in java.io.File. This method gets the total disk capacity in the bytes.
import java.io.File;
|
The output of this example depends upon number of drive you have and
the total disk capacity.
Note : As it search for drive it will take time to
display the result so wait till it complete searching.
Sample output: