其他对象
1.System
動態指定系統參數
java -DmyKey=myValue myprogrammer
2.Runtime
每個java應用程序都有一個Runtime實例,使應用程序能夠與其運行的環境相連接,可以通過getRuntime()方法獲取當前運行時
該類沒有提供構造函數。說明不可以new對象,那么會直接想到該類中的方法都是靜態的。
發現該類中還有非靜態方法,說明該類肯定會提供了方法獲取本類對象。
3.Date
public static void main(String[] args) {// TODO Auto-generated method stubDate d=new Date();System.out.println(d);//將模式封裝到SimpleDateFormat對象中SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");//format方法進行格式化String time=sdf.format(d);System.out.println(time);}?
4.Calendar
5.Math-Random
轉載于:https://www.cnblogs.com/lvjygogo/p/8729466.html
總結
- 上一篇: 初识 Vue(11)---(Vue 中的
- 下一篇: UOJ351 新年的叶子