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.YEAR(DATE())
B.DATE()-{12/15/99}
C.DATE()-100
D.DTOC(DATE())-"12/15/99"
第2题:
在下列程序的空白处,应填入的正确选项是( )。 Import java.io.*; Pulilc class ObjectStreamTest{ Publilc static void main(string args[])throws IOEx- ception{ OhiectOutputStream os=new OhjectOutputStream (new FileOutputStream("serial.bin")); Java.util.Date d=new Java.util.Date; Oos (d); ObjectInputStream is= new OhjectlnputStream(new FileOutputStream("serial. bin")); try{ java.util.date restoredDate= (Java.util.Date)ois.readObject; System.out.println ("read object back from serial.bin file:" +restoredDate); } Catch(ClassNotFoundException cnf){ System.out.println("class not found"); } }
A.WriterObject
B.Writer
C.BufferedWriter
D.writerObject
第3题:
A.var k = new Date( );
B.Date k = new Date( )
C.var k = new date( )
D.以上说法均不对
第4题:
( 11 )请在下列程序的空白处,填上适当的内容:
Import java. awt. *;
Import java. util. *;
Class BufferTest{
Public static void main(string args[])
Throws IOException{
FileOutputStream unbuf=
new FileOutputStream( “ test.one ” ) ;
BufferedOutputStream buf=
new 【 11 】 (new FileOutputStream( “ test.two ” ));
System.out.println
( “ write file unbuffered: ” + time(unbuf) + “ ms ” );
System.out.println
( “ write file buffered: ” + time(buf) + “ ms ” );
}
Static int time (OutputStream os)
Throws IOException{
Date then = new Date();
for (int i=0; i<50000; i++){
os.write(1);
}
}
os.close();
return(int)(()new Date()).getTime() - then.getTime());
}
第5题:
产生当前日期的方法是()。
第6题:
Which SQL statement displays the date March 19, 2001 in a format that appears as "Nineteenth of March 2001 12:00:00 AM"?()
第7题:
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?()
第8题:
SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'fmDdspth of Month YYYY fmHH:MI:SS AM') NEW_DATE FROM dual;
SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'Ddspth of Month YYYY fmHH:MI:SS AM') NEW_DATE FROM dual;
SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'fmDdspth of Month YYYY HH:MI:SS AM') NEW_DATE FROM dual;
SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'fmtDdspth of Month YYYY fmtHH:MI:SS AM') NEW_DATE FROM dual;
第9题:
readObject
Writer
BufferedWriter
writeObject
第10题:
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());
第11题:
alert(new Date(2011 , 12 , 25).getDay());
alert(new Date(2011 , 12 , 25 , 5).getDay());
alert(new Date(2011 , 12 , 25 , 5 , 5 , 9).getDay());
以上三个结果都正确
第12题:
SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'fmDdspth of Month YYYY fmHH:MI:SS AM') NEW_DATE FROM dual;
SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'Ddspth of Month YYYY fmHH:MI:SS AM') NEW_DATE HH:MI:SS AM') NEW _ DATE FROM dual;
SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'fmDdspth of Month YYYY NEW _ DATE FROM dual;
SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY), 'fmDdspth of Month YYYYfmtHH:HI:SS AM')NEW_DATE FROM dual;
第13题:
下列程序将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)
第14题:
A.Date()
B. Date(int year, int month, int date)
C.Date(String s)
D.Date(long date)
第15题:
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. 以上三个结果都正确
第16题:
材料:
A Passenger Ship Safety Certificate shall be issued for a period not exceeding 12 months.A Cargo Ship Safety Construction Certificate,Cargo Ship Safety Equipment Certificate and Cargo Ship Safety Radio Certificate shall be issued for a period specified by the Administration which shall not exceed five years.
An Exemption Certificate shall not be valid for longer than the period of the certificate to which it refers.
(i)When the renewal survey is completed within three months before the expiry date of the existing certificate,the new certificate shall be valid from the date of completion of the renewal survey to:
(1)for a passenger ship,a date not exceeding 12 months from the date of expiry of the existing certificate;
(2)for a cargo ship,a date not exceeding five years from the date of expiry of the existing certificate;
(ii)When the renewal survey is completed after the expiry date of the existing certificate,the new certificate shall be valid from the date of completion of the renewal survey to:
(1)for a passenger ship,a date not exceeding 12 months from the date of expiry of the existing certificate;
(2)for a cargo ship,a date not exceeding five years from the date of expiry of the existing certificate;
(iii)when the renewal survey is completed more than three months before the expiry date of the existing certificate,the new certificate shall be valid from the date of completion of the renewal survey to:
(1)for a passenger ship,a date not exceeding 12 months from the date of completion of the renewal survey;
(2)for a cargo ship,a date not exceeding five years from the date of completion of the renewal survey.
问题:
The valid period of an Exemption Certificate for Cargo Ship Safety Equipment Certificate shall be ________.
A.longer than five years
B.shorter than five years
C.longer than 12 months
D.shorter than 12 months
When the renewal survey is completed within one month before the expiry date of the existing Cargo Ship Safety Construction Certificate,the new certificate shall be valid ________.A.from the date of completion of the renewal survey to a date not exceeding 12 months from the date of expiry of the existing certificate
B.from the date of completion of the renewal survey to a date not exceeding five years from the date of expiry of the existing certificate
C.from the date of expiry of the existing certificate to a date not exceeding 12 months from the date
D.from the date of expiry of the existing certificate to a date not exceeding five years from the date
It can be concluded that the actual period of validity of a new Passenger Ship Safety Certificate is less than 12 months if the renewal survey is completed ________.A.4 months before its expiry date
B.3 months before its expiry date
C.2 months before its expiry date
D.after its expiry date
When the renewal survey is completed on a date which is 99 days before the expiry date of the existing Cargo Ship Safety Radio Certificate,the new certificate shall be valid ________.A.from the date of completion of the renewal survey to a date not exceeding 12 months from the date of expiry of the existing certificate
B.from the date of completion of the renewal survey to a date not exceeding five years from the date of expiry of the existing certificate
C.from the date of expiry of the existing certificate to a date not exceeding 12 months from the date
D.from the date of completion of the renewal survey to a date not exceeding five years from that date
请帮忙给出每个问题的正确答案和分析,谢谢!
第17题:
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?()
第18题:
Which SQL statement displays the date March 19, 2001 in a format that appears as "Nineteenth of March 2001 12:00:00 AM"?()
第19题:
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?()
第20题:
df= new DateFormat();
df= Date.getFormatter();
df= date.getFormatter();
df= date.getDateFormatter();
df = DateFormat.getDateInstance();
df= DateFormat.getInstance();
第21题:
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.
第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) { };
第24题:
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) { };