网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

Given:12.Datedate=newDate();13.df.setLocale(Locale.ITALY);14.Strings=df.format(date);ThevariabledfisanobjectoftypeDateFormatthathasbeeninitializedinline11.WhatistheresultifthiscodeisrunonDecember14,2000?()

A.Thevalueofsis14-dic-2000.

B.ThevalueofsisDec14,2000.

C.Anexceptionisthrownatruntime.

D.Compilationfailsbecauseofanerrorinline13.


参考答案

更多 “ Given:12.Datedate=newDate();13.df.setLocale(Locale.ITALY);14.Strings=df.format(date);ThevariabledfisanobjectoftypeDateFormatthathasbeeninitializedinline11.WhatistheresultifthiscodeisrunonDecember14,2000?()A.Thevalueofsis14-dic-2000.B.ThevalueofsisDec14,2000.C.Anexceptionisthrownatruntime.D.Compilationfailsbecauseofanerrorinline13. ” 相关考题
考题 下列能获取系统当前日期的是()。 A.vark=newDate();B.Datek=newDate()C.vark=newdate()D.以上说法均不对

考题 Given:1.disavalid,non-nullDateobject2.dfisavalid,non-nullDateFormatobjectsettothecurrentlocaleWhatoutputsthecurrentlocale’scountrynameandtheappropriateversionofd’sdate?() A.Localeloc=Locale.getLocale();System.out.println(loc.getDisplayCountry()++df.format(d));B.Localeloc=Locale.getDefault();System.out.println(loc.getDisplayCountry()++df.format(d));C.Localeloc=Locale.getLocale();System.out.println(loc.getDisplayCountry()++df.setDateFormat(d));D.Localeloc=Locale.getDefault();System.out.println(loc.getDisplayCountry()++df.setDateFormat(d));

考题 Datedate=newDate();13.df.setLocale(Locale.ITALY);14.Strings=df.format(date);ThevariabledfisanobjectoftypeDateFormatthathasbeeninitializedinline11.WhatistheresultifthiscodeisrunonDecember14,2000?() A.Thevalueofsis14-dic-2004.B.ThevalueofsisDec14,2000.C.Anexceptionisthrownatruntime.D.Compilationfailsbecauseofanerrorinline13.

考题 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: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();

考题 下列程序将Date对象写入文件file42.txt中,选择正确的语句填入下列程序中的横线处。 package ch1; impbrt java. io. *; import java. util. *; public class ex42 { static String fileName = "ch1\\file42.txt"; static Date date = null; public static void main(String[] args) { date = new Date(); try { FileOutputStream fos = new FileOutputStream(file Name); ObjectOutStream os = new ObjectOutputStream(fos); oos.______; oos.close(); fos.close(); System.out.println(date.toString()); } catch(Exception e) { System.out.println(e.getMessage()); } } }A.writeObject()B.writeObject(date)C.write(date)D.writeByte(date)

考题 以下可以获取系统当前日期的是( ) A.var k = new Date( );B.Date k = new Date( )C.var k = new date( )D.以上说法均不对

考题 以下哪个语句能正确弹出结果: ( ) A. alert(new Date(2011 , 12 , 25).getDay());B. alert(new Date(2011 , 12 , 25 , 5).getDay());C. alert(new Date(2011 , 12 , 25 , 5 , 5 , 9).getDay());D. 以上三个结果都正确

考题 1、产生当前日期的方法是 ()A.Now()B.Date()C.new Date()D.new Now()