SCJP題庫第158題

Given a vaid DateFormat object named df, and
16. Date d = new Date(0L);
17. String ds = "December 15, 2004";
18. //insert code here
What updates d's value with the date represented by ds?
A. 18. d = df.parse(ds);
B. 18. d = df.getDate(ds);
C. 18. try{
19. d = df.parse(ds);
20. }catch(ParseException e){}
D. 18. try{
19. d = df.getDate(ds);
20. }catch(ParseException e){}

Ans: C

解說:
那一個以ds物件的值更新了d物件的值?

Comments

Popular posts from this blog

Android-使用webview在V3版的Google地圖GPS定位