Windows で使用されているディスク容量の割合を計算しようとしています。totaldrive は c ドライブの合計ディスク容量を Long で表し、freedrive dentoes の空き容量を Long で表します。
long totaloccupied = totaldrive - freedrive;
ここで使用率の計算
Long Percentageused =(totaloccupied/totaldrive*100);
System.out.println(Percentageused);
printステートメントは0を返します。目的の値が得られないので、誰か助けてもらえますか