35. DateFormat df= DateFormat.getDateFormat(); 42. d.setTime( (60 * 60 * 24) +d.getTime());
35. DateFormat df= DateFormat.getDateJnstance(); 42. d.setTime( (1000 * 60 * 60 * 24) + d.getTime());
35. DateFormat df= DateFormat.getDateFormat(); 42. d.setLocalTime( (1000*60*60*24) + d.getLocalTime());
35. DateFormat df= DateFormat.getDateJnstance(); 42. d.setLocalTime( (60 * 60 * 24) + d.getLocalTime());
第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题:
public class TestString3 { public static void main(String[] args) { // insert code here System.out.println(s); } } Which two code fragments, inserted independently at line 3, generate the output 4247?()
第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题:
31. // some code here 32. try { 33. // some code here 34. } catch (SomeException se) { 35. // some code here 36. } finally { 37. // some code here 38. } Under which three circumstances will the code on line 37 be executed?()
第5题:
33. try { 34. // some code here 35. } catch (NullPointerException e1) { 36. System.out.print(”a”); 37. } catch (RuntimeException e2) { 38. System.out.print(”b”); 39. } finally { 40. System.out.print(”c”); 41. } What is the result if a NullPointerException occurs on line 34?()
第6题:
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){};
第7题:
class One { void foo() {} } class Two extends One { //insert method here } Which three methods, inserted individually at line 14, will correctly complete class Two?()
第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题:
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?()
第10题:
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?()