數字與字符串的轉換、常用數學函數、格式化輸出

數字轉字符串 方法1: 使用String類的靜態方法valueOf (i) 方法2: 先把基本類型裝箱爲對象,然後調用對象的toString 字符串轉數字 調用Integer的靜態方法parseInt(i); 常用數學方法 java.lang.Math 四捨五入 Math.round() 1-10之間的隨機數 隨機數 Math.random()*10; 開方 Math.sqrt(); 次方 Mat
相關文章
相關標籤/搜索