Which two allow the class Thing to be instantiated using new Thing()?
第1题:
有如下程序:
include <iostream>
using namespace std;
class ONE
{
public:
virtual void f() { cout << "1"; }
};
class TWO: public ONE
{
public:
TWO() { cout << "2"; }
};
class THREE: public TWO
{
public:
virtual void f() {TWO::f(); cout << "3"; }
};
int main()
{
ONE aa, *p;
TWO bb;
THREE cc;
p=&cc;
P->f();
return 0;
}
执行上面程序的输出是【 】。
第2题:
下列程序片段中,能通过编译的是( )。
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( ){};}
第3题:
有如下程序:
include <iostream>
using namespaee std;
class ONE{
public:
virtual void f( ){cout<<"1";}
};
class TWO:public ONE{
public:
TWO( )1 cout<<"2";}
{;
class THREE:public TWO{
public:
virtual void f( )}TWO::f( );cout<<"3";}
};
int main( ){
ONE aa,*P;
TWO bb;
THREE cc;
P=&cc;
p->f( );
return 0;
}
程序的输出结果是______。
第4题:
public class SomeException { } Class a: public class a { public void doSomething() { } } Class b: public class b extends a { public void doSomething() throws SomeException { } } Which is true about the two classes?()
第5题:
下列程序片段中,能通过编译的是( )。
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{};}
第6题:
A.public class MinMax<?> {
B.public class MinMax<? extends Number> {
C.public class MinMax<N extends Object> {
D.public class MinMax<N extends Number> {
E.public class MinMax<? extends Object> {
F.public class MinMax<N extends Integer> {
第7题:
有下列程序:
include<iostream>
using namespace std;
class ONE
{
public:
virtual void f(){COUt<<"1";}
};
c1assTWO:public ONE
{
public:
TWO(){cout<<"2";}
};
class THREE:public TWO
{
pub
第8题:
下列程序片段中,能通过编译的是
A.public abstract class Animal{ public void speak();}
B.public abstract class Animal{ public void speak(){}}
C.public class Animal{ public abstract void speak();}
D.public abstract class Animal{ public abstract void speak(){}}
第9题:
class One { public One() { System.out.print(1); } } class Two extends One { public Two() { System.out.print(2); } } class Three extends Two { public Three() { System.out.print(3); } } public class Numbers{ public static void main( String[] argv) { new Three(); } } What is the result when this code is executed?()
第10题:
In which two cases does the compiler supply a default constructor for class A?()