程序:  class MyDate{   private int year; private int month; private int day;  public MyDate(int year,int month,int day){  this.year=year;  this.month=month;      this.day=day; }  //Override Method }  为了让new MyDate(1980,11,9)==new MyDate(1980,11,9) 返回true,必须在Override Method处覆盖哪个方法?() A、 hashCodeB、 equalsC、 toStringD、 notify

程序:  class MyDate{   private int year; private int month; private int day;  public MyDate(int year,int month,int day){  this.year=year;  this.month=month;      this.day=day; }  //Override Method }  为了让new MyDate(1980,11,9)==new MyDate(1980,11,9) 返回true,必须在Override Method处覆盖哪个方法?() 

  • A、 hashCode
  • B、 equals
  • C、 toString
  • D、 notify

相关考题:

以下程序段运行的结果为()Private Sub Form_Click( )MyTime = #9:21:30 PM#MyDate = #7/21/1997#Print Tab(2); Format(MyDate, "mmmm-yy")Print Tab(2); Format(MyTime, "hh:mm:ss A/P")End SubA.July-97 9:21:30 PB.July-97 09:21:30 PC.07-97 9:21:30 PD.July-97 9:21:30

以下程序段运行的结果为()Private Sub Form_Click( )MyDate = #7/21/1997#Print Format(MyDate, "dddd,mmmm,dd,yyyy")End SubA.21,07,1997B.21,07,21,1997C.Monday,July,21,1997D.Monday,07,21,1997

对于模板定义关键字class和typename说法不正确的是( )。A.程序中的class并不能都替换为typenameB.class和typename都可互相替换C.程序中的typename都能替换为ClassD.程序中的部分class可以替换为typename

2下列程序实现对ZIP 文件file.zip 的检索,在横线处填入正确的语句是( )。package test;import java.io.*;import java.util.*; import java.util.zip.*;public class Exam{ public static void main(String[] args){ try{ FileInputStream fis = new FilelnputStream("test/file.zip"); ZipInputStream zis = new ZiplnputStream(fis); ZipEntry en; while ((______ )!= null){ en.getName(); zis.closeEntry(); } zis.close(); } catch(Exception e){ e.pfintStackTrace(); }}A.en = zis. getNextEntry()B.en == zis.getNextEntry(C.en=zis. getEntry()D.zis.getNextEntry()

有如下程序:includeusing namespace std;class test{private: int a;public: test( 有如下程序:#include<iostream>using namespace std;class test{private: int a;public: test(){cout<<"constructor"<<endl;} test(int a){cout<<a<<endl;} test(const test_test) { a=_test.a; cout<<"copy constructor"<<en+dl; } ~test(){cout<<"destructor"<<endl;}};int main(){ test A(3); rerun 0;}运行时输出的结果是A.3B.constructor destructorC.copy constructor destructorD.3 destructor

以下程序的执行结果为______。include using namespace std; class base { public: vir 以下程序的执行结果为______。include<iostream>using namespace std;class base{public:virtual void who(){cout<<"base class"<<endl;}};class derivel:public base{public:void who(){cout<<"d

下列程序实现对ZIP文件file.zip的检索,在横线处填入正确的语句( )。A.en=zis.getNextEntry( )B.en==zis.getNextEntry( )C.en=zis.getEntry( )D.zis.getNextEntry( )

有如下程序: include using namespace std; class A { public: 有如下程序: #include<iostream> using namespace std; class A { public: A(){cout<<"A";} }; class B<public:B(){cout<<"B";)); class C:public A { B b; public: C(){cout<<"C";} }; int main(){Cobj;retum 0;} 执行后的输出结果是A.CBAB.BACC.ACBD.ABC

有以下程序:include using namespace std; class Base { public: Base() { K=0; } int 有以下程序:include<iostream>using namespace std;class Base{public:Base(){K=0;}int x;};class Derivedl:virtual public Base{public:Derivedl(){x=10;}};class Derived2:virtua1 public Base

有如下程序:includeusing namespace std;class BASE{public:~BASE( ){cout 有如下程序: #include<iostream> using namespace std; class BASE{ public: ~BASE( ){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED( ){cout<<"DERIVED";} }; int main( ){DERIVED x;return 0;} 程序的输出结果是A.BASEB.DERIVEDC.BASEDERIVEDD.DERIVEDBASE

下面程序输出的结果为 #include"iostream.h" class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASSB"<<endl;} ~B() {} }; void main() { A * p; p=new B; B *q; q=new B; }A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A CLASS B CLASS A CLASS BD.CLASS A CLASS B CLASS B CLASS B

编译下面源程序会得到—文件。 class A1 { } class A2 { } public class B { public static void main(String args[]) { } }A.只有B.class文件B.只有A1.class和A2.class文件C.有A1.class、A2.class和B.class文件D.编译不成功

下面程序输出的结果为#include"iostream.h"class A{public:A( ){cout<<"CLASS A"<<endl;}~A( ){}};class B:public A{public:B( ){cout<<"CLASS B"<<endl;}~B( ){}};void main( ){A*p;p=new B;B *q;q=new B;}A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A CLASS B CLASS A CLASS BD.CLASS A CLASS B CLASS B CLASS B

对于模板定义关键宁class和typename说法不正确的是( )。A.程序中的class并不能都替换为typenameB.class和typename都可互相替换C.程序中的typename都能替换为classD.程序中的部分class可以替换为typename

有以下程序: include class A { intx; public: A(int a) { x=a;} friend class B; 有以下程序:include<iostream.h>class A{int x;public:A(int a){x=a;}friend class B;}class B{public:void print(A a){a. x--;cout<<a.x<<end1;}};void main(){A a(10);B b;b.print(a) ;}程序执行后的输出结果是【 】。

有如下程序: include using namespaee std; class A{ public: A( ){cout 有如下程序:include<iostream>using namespaee std;class A{public:A( ){cout<<"A";}~A( ){cout<<"A";}};class B{A a;public:B( ){cout<<"B";}~B( )t cout<<"B";}};int main( ){B b;return 0;}程序的输出结果是______。

下面程序输出的结果为 #include"iostream.h” class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASS B"<<endl;} ~B(){} }; void main() { A*p; p=new B;A.CLASS A CLASS B CLASS B CLASS BB.CLASS A CLASS B CLASS A CLASS BC.CLASS A CLASS B CLASS BD.CLASS A CLASS B

下列程序实现对ZIP文件file.zip的检索,在横线处 填入正确的语句( )。 package test; importjava.io.*; import java.util.*; import java.util.zip.*; public class Exam { public static void main(String[]args){ try{ FileInputStream fis=new FileInputStream("test/file. zip"); ZipInputStream zis=new ZiplnputStream(fis); ZipEntry an; while(( )!=null){ en.getName; zis.closeEntry; } zis.close: } catch(Exception e){ printStackTrace; } } }A.en=zis.getNextEntryB.en= =zis.getNextEntryC.en=zis.getEntryD.zis.getNextEntry

下面程序的输出结果是( )。 main() {struct m1{int a;int b;}en[2]={1,3,2,7); printf("%d\n",en[0].b/en[0].a*en[1].a);A.6B.0C.1D.3

下面程序输出的结果为( )。 #inClUde”iostream.h” Class A {public: A(){cout<<“CLASS A”<<endl;} ~A()<)}; class B:public A {public: B(){cout<<”CLASSB”<<endl;} ~B(){}}; void main() {A*p; p=new B; B *q; q=new B;}A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A ClASS BD.CLASS A CLASS B CLASS A CLASS B CLASS B CLASS B

下列程序片段中,能通过编译的是( )。 A.public abstract class Animal{ public void speak;}S 下列程序片段中,能通过编译的是( )。A.public abstract class Animal{ public void speak;}B.public abstract class Animal{ public void speak{);}C.public class Animal{ pubilc abstract void speak;}D.public abstract class Animal{ pubile abstract void speak{};}

下列程序实现对ZIP文件file.zip的检索,在横线处填入正确的语句 package test; import java.io.*: import java.util.*; import java.util.zip.*; public class Exam { public static void main(String[])args){ try{ FileInputStream fis=new FileInputStream("test/file.zip"); ZipInputStreamzis=new ZipInputStream(fis); ZipEntry en; while ((_____)!=null){ en.getName(); zis.closeEntry(); } zis.close(); } catch(Exception e) { e.printStackTrace(); } } }A.en = zis.getNextEntry()B.en = zis.getNextEntry()C.en = zis.getEntry()D.zis.getNextEntry()

以下程序的执行结果为______。include class A {public:A(){cout 以下程序的执行结果为______。include<iostream.h>class A{public:A(){cout<<“a”;}~A(){cout<<“b”;}};class B:public A{public:B(){cout<<“c”;)~B(){cout<<“d”;}};void main(){B b;}

在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。 include using nam 在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。include<iostream>using namespace std;class A{public: A(){cout<<'A';}};class B:【 】{public:B(){cout<<'B';)};class C:【 】{public;C(){cout<<'C';}};class D:public B,public C{public:D(){cout<<'D';}};void main(){D obi;}

单选题程序:   class MyDate{   private int year;   private int month;   private int day;   public MyDate( int year, int month,int day){   this.year=year;   this.month=month;   this.day=day;  }   //Override Method  }   为了让new MyDate(1980,11,9)==(判断是否相等)new MyDate(1980,11,9) 返 回true,必须在Override Method处覆盖哪个方法?()A hashCodeB equalsC toStringD notify

单选题在C#程序中,如果类B要继承类A,类B正确的定义为()。Apublic class B inherit ABpublic class B :: ACpublic class B : ADpublic class B from A

单选题程序:  class MyDate{   private int year; private int month; private int day;  public MyDate(int year,int month,int day){  this.year=year;  this.month=month;      this.day=day; }  //Override Method }  为了让new MyDate(1980,11,9)==new MyDate(1980,11,9) 返回true,必须在Override Method处覆盖哪个方法?()A hashCodeB equalsC toStringD notify