for (int i = 0; i < 18; i++) {
line = file.readLine();
String[] word = line.split(";");
appartment[i] = new Appartment();
appartment[i].floor= Integer.parseInt(word[0]);
appartment[i].name = word[1];
appartment[i].money= Double.parseDouble(word[2]);
appartment[i].owner= word[3];
}
有人可以告诉我为什么这不起作用吗?我从文件中读取。我正在尝试将钱从字符串转换为双倍,但它说
possible loss of precision.
required: int
found: double
我需要双打,所以业主账户也可以变成负数。