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题:
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){};
第2题:
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?()
第3题:
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?()
第4题:
14. DateFormat df; 15. Date date = new Date(); 16. //insert code here 17. String s = df.format( date); Which two,inserted independently at line 16, allow the code to compile?()
第5题:
Given: 11. public void genNumbers() { 12. ArrayList numbers = new ArrayList(); 13. for (int i=0; i<10; i++) { 14. int value = i * ((int) Math.random()); 15. Integer intObj = new Integer(value); 16. numbers.add(intObj); 17. } 18. System.out.println(numbers); 19. } Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?()
第6题:
Given a valid 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?()
第7题:
Line 19
The object is NOT a candidate for garbage collection.
Line 17
Line 16
Line 18
第8题:
B
The code runs with no output.
Compilation fails because of an error in line 12.
Compilation fails because of an error in line 15.
Compilation fails because of an error in line 18.
第9题:
B
The code runs with no output.
Compilation fails because of an error in line 12.
Compilation fails because of an error in line 15.
Compilation fails because of an error in line 18.
第10题:
The value of s is 14-dic-2000.
The value of s is Dec 14, 2000.
An exception is thrown at runtime.
Compilation fails because of an error in line 13.
第11题:
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());
第12题:
On DS1, disable preempt
On DS2, decrease the priority value to a value less than 150
On DS1, increase the decrement value in the track command to a value greater than 6
On DS1, disable track command.
第13题:
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?()
第14题:
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?()
第15题:
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?()
第16题:
10. class Line { 11. public class Point { public int x,y; } 12. public Point getPoint() { return new Point(); } 13. } 14. class Triangle { 15. public Triangle() { 16. // insert code here 17. } 18. } Which code, inserted at line 16, correctly retrieves a local instance of a Point object?()
第17题:
Given: 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?()
第18题:
Locale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry()+ + df.format(d));
Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry()+ + df.format(d));
Locale loc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+ + df.setDateFormat(d));
Locale loc = Locale.getDefault();System.out.println(loc.getDisplayCountry()+ + df.setDateFormat(d));
第19题:
Point p = Line.getPoint();
Line.Point p = Line.getPoint();
Point p = (new Line()).getPoint();
Line.Point p = (new Line()).getPoint();
第20题:
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) { };
第21题:
df= new DateFormat();
df= Date.getFormatter();
df= date.getFormatter();
df= date.getDateFormatter();
df = DateFormat.getDateInstance();
df= DateFormat.getInstance();
第22题:
The value of s is 14-dic-2004.
The value of s is Dec 14, 2000.
An exception is thrown at runtime.
Compilation fails because of an error in line 13.
第23题:
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) { };