(7-1)以下程序的运行结果是()。 class A{ A(){ System.out.print(10); } } public class Demo extends A { public static void main(String[] args) { new A(); new Demo(); } }
A.10
B.10 10
C.编译失败
D.程序可以正常运行,但没有输出内容
A.10
B.10 10
C.编译失败
D.程序可以正常运行,但没有输出内容
A、代码得到编译,并输出“a=0”。
B、代码得到编译,并输出“a=null”。
C、由于a没有初始化,代码不能编译通过。
D、代码得到编译,但捕获到NullPointException异常。
A、private
B、protected
C、internal
D、public
A.TestClass(TestClass &other){number=other.number;}
B.TestClass(TestClass other){number=other.number;}
C.TestClass(TestClass &other){number;}
D.TestClass(&other){number=other.number;}
A、A public float getNum(){return 4.0f;}
B、B public void getNum(){}
C、C public void getNum(double d){}
D、D public double getNum(float d){return 4.0d; }
template<typenameTYPE>
classMyClass{
TYPE n;
public:
MyClass(TYPE k);
…
};
其中构造函数MyClass用的值初始化数据成员n。因此在模板类体外,构造函数MyClass应定义______。
A、Thread myThread = new Thread(); my Thread.Start();
B、Thread myThread = new Thread(new ThreadStart(Method)); myThread.Start();
C、Thread myThread = new Thread(new ThreadStart(Method)); myThread.Run();
D、Thread myThread = new Thread(); myThread.Run ();
A、a=cA.b;
B、a=cA.get();
C、a=cB.b;
D、以上都不对
A、30
B、30.0
C、30.000
D、编译失败
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!