API雜記——Integer
1。int i = Integer.decode("123").intValue();——將字符串轉(zhuǎn)為int??int?i = Integer.parseInt("11223344");——將字符串轉(zhuǎn)為int
??System.setProperty("int","123456");
??int i = Integer.getInteger("int").intValue();——確定具有指定名稱的系統(tǒng)屬性的整數(shù)值。
??int i = Integer.getInteger("int",123456).intValue();——i=1234565
???i = Integer.signum(123);——返回指定 int 值的符號函數(shù),正數(shù)返回1,負數(shù)返回-1
???Integer.valueOf();——返回一個Integer 實例,參數(shù)可以是int或者String。
2。Collection.nCopies(int?n, T?o)
??????????返回由指定對象的 n 個副本組成的不可變列表。
posted on 2006-04-29 17:29 扭轉(zhuǎn)乾坤 閱讀(264) 評論(0) 編輯 收藏 所屬分類: JAVA常用技巧