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.
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.
相关考题:
有以下程序:class Date{public:Date(int y,int m,int d);{year=y;month=mday=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<<endl;}private:int year,month,day;};Date fun(Date d){Date temp;temp=d;return temp;}int main( ){Date datel(2000,1,1),date2(0,0,0);Date date3(datel);date2=fun(date3);return 0;}程序执行时,Date类的拷贝构造函数被调用的次数是A.2B.3C.4D.5
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: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.
有以下程序: 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.2B.3C.4D.5
有以下程序: classDate {public: Date(inty,intm,intd); {year=Y; month=m; day=d;} Date(inty=2000) {year=y; month=10; day=1;} Date(Date&d) {year=d.year; month=d.month; day=d.day;} voidprint() {coutyear"."month"." dayendl;} private: intyear,month,day;}; Datefun(Dated) {Datetemp; temp=d; returntemp;} intmain() {Datedatel(2000,1,1),date2(0,0,O); Datedate3(date1); date2=fun(date3); return0;} 程序执行时,Date类的复制构造函数被调用的次数是( )。A.2B.3C.4D.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 = d.day; } void print() { cout<<year<<"."<<month<<"."<<day<<endl; } private: int year,month,day; }; Date fun(Date d) { Date temp; temp = d; resurn temp; } int main () { Date date1 (2000,1,1),date2 (0,0,0); Date date3 (date1); date2 = fun(date3); return 0; } 程序执行时,Date类的拷贝构造函数被调用的次数是A.2B.3C.4D.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.2B.3C.4D.5
有以下程序: classDate { public: Date(inty,intm,intd); { year=Y: month=m; day=d; } Date(inty=2000) { year=y; month=10; day=1; } Date(Date&d){ year=d.year; month=d.month; day=d.day; } voidprint( ) { coutyear"."(month"."dayendl; } private: intyear,month,day; }; Datefun(Dated) { Datetemp; temp=d; returntemp; } intmain( ) { Datedatel(2000,1,1),date2(0,0,0); Datedate3(datel); date2=fun(date3); return0; } 程序执行时,Date类的拷贝构造函数被调用的次数是( )。A.2B.3C.4D.5
有以下程序:classDate{public:Date(inty,intm,intd);{year=Y;month=m;day=d;}Date(inty=2000){year=y;month=10;day=1;}Date(Date&d){year=d.year;month=d.month;day=d.day;}voidprint(){coutyear.month.dayendl;}private:intyear,month,day;};Datefun(Dated){Datetemp;temp=d;returntemp;}intmain(){Datedatel(2000,1,1),date2(0,0,O);Datedate3(date1);date2=fun(date3);return0;}程序执行时,Date类的复制构造函数被调用的次数是( )。A.2B.3C.4D.5