請見以下範例,注意 round() 的返回值型態為 long 。 double d = 1.999; System.out.println(Math.round(d)); // ...
確定! 回上一頁