[請問] 一條爪哇問題
public static void main(String[] args) throws Exception {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date birth = dateFormat.parse("1966-08-08");
Date current = new Date();
long life = current.getTime() - birth.getTime();
System.out.println("你今年的歲數為:" + (life / (365 * 24 * 60 * 60
* 1000))); }}
為何歲數爆掉是因為?
public class Main { public static void main(String[] args) {
System.out.println(Integer.MIN_VALUE == -Integer.MIN_VALUE); }}
為何為true阿 不是沒有用""括起來 不是同一物件
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.168.243.189
※ 編輯: badbadook 來自: 118.168.243.189 (06/08 22:28)
※ 編輯: badbadook 來自: 118.168.243.189 (06/08 23:37)
推
06/09 00:20, , 1F
06/09 00:20, 1F
→
06/09 00:22, , 2F
06/09 00:22, 2F
推
06/09 00:24, , 3F
06/09 00:24, 3F
討論串 (同標題文章)