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 w

题目

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());

相似考题
更多“33. Date d =&ens”相关问题
  • 第1题:

    Youarecreatinganonlinecatalogapplicationthat&ens

    YouarecreatinganonlinecatalogapplicationthatwilldisplayproductinformationonthecompanyWebsite.TheproductdataisstoredinaSQLServer2005database.ThedataisstoredasrelationaldatabutmustbepassedtotheapplicationasanXMLdocumentbyusingFORXML.YoutestyourapplicationandnoticethatnotalloftheitemsmatchingyourqueryappearintheXMLdocument.Onlythoseproductsthathavevaluesforallelementsintheschemaappear.

    YouneedtomodifyyourTransact-SQLstatementsothatallproductsmatchingyourqueryappearintheXMLdocument.

    Whatshouldyoudo?()


    参考答案:B

  • 第2题:

    查询十天前的记录应使用( )作为准则。

    A.Between Date( )And Date( )-10

    B.<Date( )-10

    C.>Date( )-10

    D.Between Date( )-10 And Date( )


    正确答案:B

  • 第3题:

    设有如下变量声明: Dim Test Date AS Date 为变量Test Date正确赋值的表达式是( )。

    A.Test Date=#1/1/2002#

    B.TestDate#"1/1/2002"#

    C.Test Date=date("1/1/2002")

    D.Test Date=Format("m/d/yy","1/1/2002")


    正确答案:A
    解析:本题考查日期型数据的用法,题目难度较小。解答本题首先应该注意日期型数据单独存在时前后需要用#号,选项B书写错误: Date函数不能带参数,选项C错误;Format函数可以将字符串数据转换为日期形式,但是该函数的格式是:Format(expressionLformat]- Lfirstofweek[,firstweekofye盯)D,即选项D中两个参数的顺序出现错误。答案为A。

  • 第4题:

    某数据库表中有1个工作时间字段,查找20天之内参加工作的记录的准则可以是( )。

    A.Between Date()Or Date()-20

    B.Between Date()And Date()-20

    C.Date()-20

    D.Date()-20


    正确答案:B
    解析:本题考查Access中日期时间函数的用法。Date(date)返回给定日期1~31的值,表示给定日期是一个月中的哪一天;Date()返回当前系统日期;Between用于指定一个字段值的范围,指定的范围之间用And连接。选项A和 D使用Or连接是错误的,选项C的用法是错误的,答案为B。

  • 第5题:

    有以下程序: class Date { public: Date(int y, int m, int d); year = y; month = m; day = d; Date(int y = 2000) year = y; month = 10; day = 1; Date(Date &d) { year = d.year; month = d.month; day = a.day; } void print() cout<<year<<"."<<month<<"."<<day<<end1; } private: int year, month,day; }; Date fun(Date d) Date temp; temp = d; return temp; } int main() { Date date 1 (2000,1,1),date2(0,0,0); Date date3(date 1); date2 = fun(date3); return 0; } 程序执行时,Date 类的拷贝构造函数被调用的次数是

    A.2

    B.3

    C.4

    D.5


    正确答案:B
    解析:本题考核拷贝构造函数。上述程序中,拷贝构造函数一共被调用了3次:第一次是在执行语句Datedate3(date1);时,用已经建立的对象date1对正在建立的对象date3进行初始化;第二次是在调用fun函数时,由于是传值调用,因此实参对象date3要对形参对象d进行初始化;第三次是在执行fun函数中的返回语句returntemp;时,系统用返回初始化一个匿名对象时使用了拷贝构造函数。

  • 第6题:

    下列方法中,用于返回当前日期的方法是?()

    A.Date()

    B. Date(int year, int month, int date)

    C.Date(String s)

    D.Date(long date)


    答案:A

  • 第7题:

    在某数据表中的执勤时间字段查找执勤时间30 之内的准则是( )。

    A.Between Date()Or Date-30

    B.Between Date()And Date()-30

    C.<Date()And>Date()-30

    D.<Date()Or>Date()-30


    正确答案:B
    解析:Date(date)返回给定日期1~31的值,表示给定日期是一个月中的哪一天;Date()返回系统当前日期;Between用于指定一个字段值的范围,指定的范围之间用And连接。选项A和D使用or连接是错误的,选项C的用法是错误的,答案为B。

  • 第8题:

    In the video form. the OrderDate field (Which shows When the video may be ordered)is calculated based on the Date field (Which displays the release date ). The order date is 30 days prior to  the release date. Which one the following formulas will calculate the OrderDate value?()

    • A、@Number(Date)-30       
    • B、@Adjust(Date;0;0;30;0;0;0) 
    • C、@Adjust(Date;0;0;-30;0;0;0) 
    • D、@If(Date!="";Date-30;@Failure(There is no current release date")) 

    正确答案:C

  • 第9题:

    linux系统,把当前日期标准输出和标准出错信息重定向到/tmp/date文件中,下面正确的操作是()。

    • A、date>/tmp/date
    • B、date>>/tmp/date
    • C、date2>>/tmp/date
    • D、date&>/tmp/date

    正确答案:D

  • 第10题:

    在VisualFoxpro中,运算结果是日期型数据的表达式有()。

    • A、DATE()+YEAR(DATE())
    • B、{^01/01/03}+YEAR(DATE())
    • C、DATE()-("12/06/99")
    • D、DATE()+20

    正确答案:A,B,D

  • 第11题:

    单选题
    In the video form. the OrderDate field (Which shows When the video may be ordered)is calculated based on the Date field (Which displays the release date ). The order date is 30 days prior to  the release date. Which one the following formulas will calculate the OrderDate value?()
    A

    @Number(Date)-30       

    B

    @Adjust(Date;0;0;30;0;0;0) 

    C

    @Adjust(Date;0;0;-30;0;0;0) 

    D

    @If(Date!=;Date-30;@Failure(There is no current release date)) 


    正确答案: B
    解析: 暂无解析

  • 第12题:

    多选题
    Based on which two conditions can master Preventive Maintenance (PM) schedules be created?()
    A

    elapsed time since the target start date or completion date of previous work generated by PM

    B

    difference between completion date of previous work and system date is equal to Lead Time

    C

    elapsed time since the target start date or completion date of the latest work orders for the asset

    D

    metered equipment usage since the target start date or completion date of previous work generated by PM

    E

    metered equipment usage since the target start date or completion date of the latest work order for the asset


    正确答案: D,E
    解析: 暂无解析

  • 第13题:

    Examine the description of the STUDENTS table:Which two aggregate functions are valid on the START_DATE column?()

    A. SUM(start_date)

    B. AVG(start_date)

    C. COUNT(start_date)

    D. AVG(start_date, end_date)

    E. MIN(start_date)

    F. MAXIMUM(start_date)


    参考答案:C, E

  • 第14题:

    有以下程序: class Date { public: Date(int y,int m,int D) ; { year =y; month=m; day=d; } Date(int y=2000) { year=y; month=10; day=1; } Date(Date &D) { year=d.year; month=d.month; day=d.day; } void print () { cout<<year<<"."<<month<<"."<<day<<end1; } private: int year,month,day; }; Date fun(Date D) { Date temp; temp=d; return temp; } int main() { Date date1(2000,1,1),date2(0,0,0); Date date3(date1); date2=fun(date3); return 0; } 程序执行时,Date类的拷贝构造函数被调用的次数是

    A.2

    B.3

    C.4

    D.5


    正确答案:B
    解析:本题考核拷贝构造函数。上述程序中,拷贝构造函数一共被调用了3次:第一次是在执行语句Datedate3(date1);时,用已经建立的对象date1对正在建立的对象date3进行初始化:第二次是在调用fun函数时,由于是传值调用,因此实参对象date3要对形参对象d进行初始化;第三次是在执行fun函数中的返回语句returntemp;时,系统用返回初始化一个匿名对象时使用了拷贝构造函数。

  • 第15题:

    查询最近30天的记录应俄用( )作为准则

    A. Between Date(1 And Date0—30

    B. Between Date一30 And Date

    C. <=Date-30

    D. <Date0-30


    正确答案:B
    本题考查查询准则的知识。获得当前日期可以使用系统函数Date.而当前日期的30天前就是日期Date-30。最近30天内的记录,也就是日期在这个区间内的记录,使用关键字 Between…And…来表示在区间内。注意先写下限后写上限。

  • 第16题:

    查询最近30天的记录应使用( )作为准则。

    A.Between Date()And Date()一30

    B.Between Date()一30 And Date()

    C.<;=Date()一30

    D.<;Date()一30


    正确答案:B
    B.【解析】本题考查查询准则的知识。获得当前日期可以使用系统函数Date(),而当前日期的30天前就是日期Date()一30。最近30天内的记录,也就是日期在这个区间内的记录,使用关键字Between…And…来表示在区间内,注意先写下限后写上限。

  • 第17题:

    下列关于javA.util.Date类的描述中,错误的是?()

    A.无参的构造方法Date(),用来创建当前日期时间的Date对象

    B.在JDK的javA.util包中提供了一个Date类用于表示日期和时间

    C.推荐使用Date(int year,int month,int date)构造方法来创建Date对象

    D.接收一个long型参数date的构造方法Date(long date),用于创建指定时间的Date对象


    答案:C
    解析:Date(int year,int month,int date)构造方法已经过时,Date类中只有两个构造方法是建议使用的,一个是无参的构造方法Date(),用来创建当前日期时间的Date对象。另一个是接收一个long型参数date的构造方法Date(long date),用于创建指定时间的Date对象。

  • 第18题:

    Alloftheclientcomputersinyourcompany’s&ens

    Alloftheclientcomputersinyourcompany’snetworkareWindows2000portablecomputers.AusernamedMariastoresSalesfilesinherMyDocumentsfolder.Sheusesthesefileswhenshetravels.

    Mariainformsyouthatwhenshetakesherportablecomputertotradeshows,shecanaccesssomeoftheSalesfilesbutnotallofthem.Whenherportablecomputerisconnectedtothenetworkattheoffice,shecanaccessallofthefiles.YouneedtoenableMariatoaccessallofthefilesinherMyDocumentsfolderwhensheisworkingremotely.

    Whatshouldyoudo?()


    参考答案:C

    TogiveMariaaccesstothefileswhensheisworkingremotely,thefolderneedstobeenabledforofflineaccessandmustbeconfiguredtomaketheentirecontentsofthefolderavailableoffline.

  • 第19题:

    查询最近30天的记录应使用( )作为准则。

    A)Between Date( )And Date( )-30

    B)Between Date( )-30 And Date( )

    C)<=Date( )-30

    D)<Date( )-30


    正确答案:B
    本题考查查询准则的知识。获得当前日期可以使用系统函数Date0,而当前日期的30天前就是日期Date0.30。最近30天内的记录,也就是日期在这个区间内的记录,使用关键字Between…And…来表示在区间内,注意先写F限后写上限。

  • 第20题:

    Based on which two conditions can master Preventive Maintenance (PM) schedules be created?()

    • A、 elapsed time since the target start date or completion date of previous work generated by PM  
    • B、 difference between completion date of previous work and system date is equal to Lead Time  
    • C、 elapsed time since the target start date or completion date of the latest work orders for the asset
    • D、 metered equipment usage since the target start date or completion date of previous work generated by PM
    • E、 metered equipment usage since the target start date or completion date of the latest work order for the asset

    正确答案:A,D

  • 第21题:

    Stringdate="TodayisSunday";把date转换成全小写的语句是()

    • A、toLowerCase(date);
    • B、date.toLowerCase();
    • C、date.toUpperCase();
    • D、toUpperCase(date);

    正确答案:B

  • 第22题:

    Examine the description of the STUDENTS table: STD_ID NUMBER(4) COURSE_ID VARCHAR2(10) START_DATE DATE END_DATE DATE Which two aggregate functions are valid on the START_DATE column? ( )

    • A、SUM(start_date)
    • B、AVG(start_date)
    • C、COUNT(start_date)
    • D、AVG(start_date,end_date)
    • E、MIN(start_date)
    • F、MAXIMUM(start_date)

    正确答案:C,E

  • 第23题:

    多选题
    Examine the description of the STUDENTS table: STD_ID NUMBER(4) COURSE_ID VARCHAR2(10) START_DATE DATE END_DATE DATE Which two aggregate functions are valid on the START_DATE column? ( )
    A

    SUM(start_date)

    B

    AVG(start_date)

    C

    COUNT(start_date)

    D

    AVG(start_date,end_date)

    E

    MIN(start_date)

    F

    MAXIMUM(start_date)


    正确答案: F,A
    解析: 暂无解析

  • 第24题:

    多选题
    Examine the description of the STUDENTS table: STD_ID NUMBER(4) COURSE_ID VARCHARD2(10) START_DATE DATE END_DATE DATE Which two aggregate functions are valid on the START_DATE column?()
    A

    SUM(start_date)

    B

    AVG(start_date)

    C

    COUNT(start_date)

    D

    AVG(start_date, end_date)

    E

    MIN(start_date)

    F

    MAXIMUM(start_date)


    正确答案: B,E
    解析: 暂无解析