18. d = df.parse(ds);
18. d = df.getDate(ds);
18. try {19. d = df.parse(ds);20. } catch(ParseException e) { };
18. try {19. d = df.getDate(ds);20. } catch(ParseException e) { };
第1题:
33.Dated=newDate(0);34.Stringds=December15,2004”;35.//insertcodehere36.try{37.d=df.parse(ds);38.}39.catch(ParseExceptione){40.System.out.println(”Unabletoparse+ds);41.}42.//insertcodeheretooWhichwillcreatetheappropriateDateFormatobjectandaddadaytotheDateobject?()
A.35.DateFormatdf=DateFormat.getDateFormat();42.d.setTime((60*60*24)+d.getTime());
B.35.DateFormatdf=DateFormat.getDateJnstance();42.d.setTime((1000*60*60*24)+d.getTime());
C.35.DateFormatdf=DateFormat.getDateFormat();42.d.setLocalTime((1000*60*60*24)+d.getLocalTime());
D.35.DateFormatdf=DateFormat.getDateJnstance();42.d.setLocalTime((60*60*24)+d.getLocalTime());
第2题:
A.18.d=df.parse(ds);
B.18.d=df.getDate(ds);
C.18.try{19.d=df.parse(ds);20.}catch(ParseExceptione){};
D.18.try{19.d=df.getDate(ds);20.}catch(ParseExceptione){};
第3题:
A.18.d=df.parse(ds);
B.18.d=df.getDate(ds);
C.18.try{19.d=df.parse(ds);20.}catch(ParseExceptione){}
D.18.try{19.d=df.getDate(ds);20.}catch(ParseExceptione){}
第4题:
12. Date date = new Date(); 13. df.setLocale(Locale.ITALY); 14. String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()
第5题:
11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B”); } 16. } 17. public static void main(String[] args) { 18. new B().process(); 19. } What is the result?()
第6题:
A.df = new DateFormat();
B.df = Date.getFormat();
C.df = date.getFormat();
D.df = DateFormat.getFormat();
E.df = DateFormat.getInstance();
第7题:
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?()
第8题:
A.18.d=df.parse(ds);
B.18.d=df.getDate(ds);
C.18.try{19.d=df.parse(ds); 20.}catch(ParseExceptione){};
D.18.try{ 19.d=df.getDate(ds); 20.}catch(ParseExceptione){};
第9题:
33. Date d = new Date(0); 34. String ds = “December 15, 2004”; 35. // insert code here 36. try { 37. d = df.parse(ds); 38. } 39. catch(ParseException e) { 40. System.out.println(”Unable to parse “+ ds); 41. } 42. // insert code here too Which will create the appropriate DateFormat object and add a day to the Date object?()
第10题:
Given: 1.d is a valid, non-null Date object 2.df is a valid, non-null DateFormat object set to the current locale What outputs the current locale’s country name and the appropriate version of d’s date?()