【发布时间】:2022-05-14 03:00:03
【问题描述】:
I was writing this code:
public static void main(String[] args) {
double g = 1 / 3;
System.out.printf("%.2f", g);
}
The result is 0. Why is this, and how do I solve this problem?
【问题讨论】:
标签: java integer-division