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();
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();
相关考题:
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());
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());
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.
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: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());
下列程序将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)
1、产生当前日期的方法是 ()A.Now()B.Date()C.new Date()D.new Now()