单选题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?()A18. d = df.parse(ds);B18. d = df.getDate(ds);C18. try {19. d = df.parse(ds);20. } catch(ParseException e) { };D18. try {19. d = df.getDate(ds);20. } catch(ParseException e) { };

单选题
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?()
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) { };


参考解析

解析: 暂无解析

相关考题:

DateFormatdf;15.Datedate=newDate();16.//insertcodehere17.Strings=df.format(date);Whichtwo,insertedindependentlyatline16,allowthecodetocompile?() A.df=newDateFormat();B.df=Date.getFormatter();C.df=date.getFormatter();D.df=date.getDateFormatter();E.df=DateFormat.getDateInstance();F.df=DateFormat.getInstance();

Given:What is the result?() A.Compilation fails.B.exception is thrown at runtime.C.The attribute id in the ItemTest object remains unchanged.D.The attribute id in the ItemTest object is modified to the new value.E.A new ItemTest object is created with the preferred value in the id attribute.

Given:Which code fragment, inserted at line 23, allows the code to compile?() A.df = new DateFormat();B.df = Date.getFormat();C.df = date.getFormat();D.df = DateFormat.getFormat();E.df = DateFormat.getInstance();

Given that the current directory is empty, and that the user has read and write permissions, and the following:Which statement is true?() A.Compilation fails.B.The file system has a new empty directory named dir.C.The file system has a new empty directory named newDir.D.The file system has a directory named dir, containing a file f1.txt.E.The file system has a directory named newDir, containing a file f1.txt.

Given:Which code, inserted at line 16, correctly retrieves a local instance of a Point object?() A.Point p = Line.getPoint();B.Line.Point p = Line.getPoint();C.Point p = (new Line()).getPoint();D.Line.Point p = (new Line()).getPoint();

Given:WhatcreatestheappropriateDateFormatobjectandaddsadaytotheDateobject?() A.35.DateFormatdf=DateFormat.getDateFormat();42.d.setTime((60*60*24)+d.getTime());B.35.DateFormatdf=DateFormat.getDateInstance();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.getDateInstance();42.d.setLocalTime((60*60*24)+d.getLocalTime());

Which statements are true, given the code new FileOutputStream("data", true) for creating an object of class FileOutputStream?()  A、FileOutputStream has no constructors matching the given arguments.B、An IOExeception will be thrown if a file named "data" already exists.C、An IOExeception will be thrown if a file named "data" does not already exist.D、If a file named "data" exists, its contents will be reset and overwritten.E、If a file named "data" exists, output will be appended to its current contents.

Given that Thing is a class, how many objects and reference variables are created by the following code?()   Thing item, stuff;   item = new Thing();   Thing entity = new Thing();A、One object is createdB、Two objects are createdC、Three objects are createdD、One reference variable is createdE、Two reference variables are createdF、Three reference variables are created.

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?() A、 The value of s is 14-dic-2004.B、 The value of s is Dec 14, 2000.C、 An exception is thrown at runtime.D、 Compilation fails because of an error in line 13.

Given the following code fragment:     public void create() {     Vector myVect;     myVect = new Vector();      }  Which of the following statements are true?() A、 The declaration on line 2 does not allocate memory space for the variable myVect.B、 The declaration on line 2 allocates memory space for a reference to a Vector object.C、 The statement on line 2 creates an object of class Vector.D、 The statement on line 3 creates an object of class Vector.E、 The statement on line 3 allocates memory space for an object of class Vector.

Given that session is a valid HttpSession object:   Int max = session.getAttribute(“MyReallyLongName”);   Which is true?()  A、 The value returned needs to be cast to an int.B、 The getAttribute methos takes two arguments.C、 Primitive CANNOT be stored in the HttpSession.D、 The HttpSession attribute name must NOT exceed eight characters.

10. class MakeFile {  11. public static void main(String[] args) {  12. try {  13. File directory = new File(”d”);  14. File file = new File(directory,”f”);  15. if(!file.exists()) {  16. file.createNewFile();  17. }  18. } catch (IOException e) {  19. e.printStackTrace  20. }  21. }  22. }  The current directory does NOT contain a directory named “d.” Which three are true?()A、 Line 16 is never executed.B、 An exception is thrown at runtime.C、 Line 13 creates a File object named “d”.D、 Line 14 creates a File object named “f‟.E、 Line 13 creates a directory named “d” in the file system.F、 Line 16 creates a directory named “d” and a file “f”  within it in the file system.G、 Line 14 creates a file named "f " inside of the directory named “d” in the file system.

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?()A、 df= new DateFormat();B、 df= Date.getFormatter();C、 df= date.getFormatter();D、 df= date.getDateFormatter();E、df = DateFormat.getDateInstance();F、 df= DateFormat.getInstance();

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?()A、The value of s is 14-dic-2000.B、The value of s is Dec 14, 2000.C、An exception is thrown at runtime.D、Compilation fails because of an error in line 13.

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?()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) { };

You are the network administrator for The network consists of a single Active Directory domain named All network servers run Windows Server 2003. A member server named TK1 contains a large number of files that are frequently accessed by network users. Users report unacceptable response times on TK1. You compare the current performance of TK1 to a system performance baseline that you created several weeks ago. You decide that TK1 needs a higher-performance network adapter. After you add the appropriate network adapter, users report satisfactory performance. You need to gather new server performance data so you can establish a new performance baseline for TK1. You open the Performance console. What should you do next?()A、Add all counters for the Network Interface object to the System Monitor object.B、Create a new trace log object. Under Events logged by system provider in the new object, select the Network TCP/IP setting. Start the trace log.C、Create a new counter log object. Add all counters for the Network Interface object to the new object. Start the counter.D、Create a new alert object.

单选题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?()ALocale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry()+   + df.format(d));BLocale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry()+   + df.format(d));CLocale loc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+   + df.setDateFormat(d));D Locale loc = Locale.getDefault();System.out.println(loc.getDisplayCountry()+   + df.setDateFormat(d));

单选题Given: What is the result? ()A  A new Item object is created with the preferred value in the id attribute.B  The attribute id in the Item object is modified to the new value.C  Compilation fails.D  An exception is thrown at runtime.E  The attribute id in the Item object remains unchanged.

多选题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?()Adf= new DateFormat();Bdf= Date.getFormatter();Cdf= date.getFormatter();Ddf= date.getDateFormatter();Edf = DateFormat.getDateInstance();Fdf= DateFormat.getInstance();

单选题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?()A18. d = df.parse(ds);B18. d = df.getDate(ds);C18. try {19. d = df.parse(ds);20. } catch(ParseException e) { };D18. try {19. d = df.getDate(ds);20. } catch(ParseException e) { };

单选题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?()AThe value of s is 14-dic-2000.BThe value of s is Dec 14, 2000.CAn exception is thrown at runtime.DCompilation fails because of an error in line 13.

单选题Which statements are true, given the code new FileOutputStream("data", true) for creating an object of class FileOutputStream?()AFileOutputStream has no constructors matching the given arguments.BAn IOExeception will be thrown if a file named data already exists.CAn IOExeception will be thrown if a file named data does not already exist.DIf a file named data exists, its contents will be reset and overwritten.EIf a file named data exists, output will be appended to its current contents.

单选题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?()A 35. DateFormat df= DateFormat.getDateFormat(); 42. d.setTime( (60 * 60 * 24) +d.getTime());B 35. DateFormat df= DateFormat.getDateJnstance(); 42. d.setTime( (1000 * 60 * 60 * 24) + d.getTime());C 35. DateFormat df= DateFormat.getDateFormat(); 42. d.setLocalTime( (1000*60*60*24) + d.getLocalTime());D 35. DateFormat df= DateFormat.getDateJnstance(); 42. d.setLocalTime( (60 * 60 * 24) + d.getLocalTime());

单选题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?()A The value of s is 14-dic-2004.B The value of s is Dec 14, 2000.C An exception is thrown at runtime.D Compilation fails because of an error in line 13.

单选题Given that session is a valid HttpSession object:   Int max = session.getAttribute(“MyReallyLongName”);   Which is true?()A The value returned needs to be cast to an int.B The getAttribute methos takes two arguments.C Primitive CANNOT be stored in the HttpSession.D The HttpSession attribute name must NOT exceed eight characters.

多选题Given that Thing is a class, how many objects and reference variables are created by the following code?()   Thing item, stuff;   item = new Thing();   Thing entity = new Thing();AOne object is createdBTwo objects are createdCThree objects are createdDOne reference variable is createdETwo reference variables are createdFThree reference variables are created.

单选题You are the network administrator for The network consists of a single Active Directory domain named All network servers run Windows Server 2003. A member server named TK1 contains a large number of files that are frequently accessed by network users. Users report unacceptable response times on TK1. You compare the current performance of TK1 to a system performance baseline that you created several weeks ago. You decide that TK1 needs a higher-performance network adapter. After you add the appropriate network adapter, users report satisfactory performance. You need to gather new server performance data so you can establish a new performance baseline for TK1. You open the Performance console. What should you do next?()AAdd all counters for the Network Interface object to the System Monitor object.BCreate a new trace log object. Under Events logged by system provider in the new object, select the Network TCP/IP setting. Start the trace log.CCreate a new counter log object. Add all counters for the Network Interface object to the new object. Start the counter.DCreate a new alert object.