%d is for integers use %f instead, it works for both float and double types: double d = 1.2; float f = 1.2f; System.out.printf("%f %f",d,f); ...
確定! 回上一頁