关于Double,Long的Java泛型

时间:2017-01-18 23:33:14

标签: java generics

double izracun = visina / (double)gorDol * sirina / (double)levoDesno;

T smallestVolume;
if (smallestVolume == (long)smallestVolume) {
    smallestVolume = (Long)Math.round(izracun);
} else {
    smallestVolume = (Double)izracun;
}

我首先检查一个数字是1.35还是1.00,如果它是1.00我想要打印出来1.现在我想用泛型来做这个。以上情况当然不起作用。

0 个答案:

没有答案