首页 > 职业资格考试
题目内容 (请给出正确答案)
[主观题]

考虑如下类:1. class Test(int i) {2. void test(int i) {3. System.out.println("I am an

考虑如下类:

1. class Test(int i) {

2. void test(int i) {

3. System.out.println("I am an int.");

4. }

5. void test(String s) {

6. System.out.println("I am a string.");

7. }

8.

9. public static void main(String args[]) {

10. Test t=new Test();

11. char ch="y";

12. t.test(ch);

13. }

14. }

以下哪条为真?

A.行 5 不能通过编译,方法不能被覆盖.

B.行 12 不能通过编译, 因为没有一个test()方法含字符参数.

C.代码可以编译但在12行将出现异常.

D.代码可以编译且产生如下输出: I am an int.

E.代码可以编译且产生如下输出: I am a String.

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“考虑如下类:1. class Test(int i) {2.…”相关的问题
第1题
"如下代码创建一个新线程并启动线程:Runnable target=new MyRunnable();Thread myThread=new Thread(target);问:如下哪些类可以创建target对象,并能编译正确

A.public class MyRunnable extends Runnable{public void run(){}}

B.public class MyRunnable extends Object{public void run(){}}

C.public class MyRunnable implements Runnable{public void run(){}}

D.public class MyRunnable extends Runnable{void run(){}}

点击查看答案
第2题
如下代码创建一个新线程并启动线程: Runnable target=new MyRunnable(); Thread myThread=new Thread(target); 问:如 些类可以创建target对象,并能编译正确

A.public class MyRunnable extends Runnable { public void run(){} }

B.public class MyRunnable extends Object { public void run(){} }

C.public class MyRunnable implements Runnable {public void run(){}}

D.public class MyRunnable implements Runnable {void run(){}}

点击查看答案
第3题
包容类(也称外围类)Contain和内嵌类(也称嵌套类)Embed定义如下: #include <iostream.h> class Contain { int x; protected: int z; public: class Embed { int y; public: Embed(){y=100;} int Embed__Fun(); }MyEmbed; int Contain__Fun(); }; 对上面的定义,正确的描述是

A.定义类Embed对象的语句是:Contain::Embed embed

B.类Contain的成员函数Contain_Fun()中可以用MyEmbed.y的方式访问类Embed的私有成员y

C.类Embed的成员函数Embed_Fun()中可以直接访问类Contain的私有成员x

D.类Embed的成员函数Embed_Fun()中可以直接访问类Contain的保护成员z

点击查看答案
第4题
1public class Test{ public static void main(String[ ] args) { String nam

1public class Test{ public static void main(String[ ] args) { String name[ ]=new String[5]; for(int i=0; i<args.length; ++i) name[i] = args[i]; System.out.println(name[2]); } } 命令行中的输入为:java Test a b 程序的输出是【 】 。

点击查看答案
第5题
下列代码的执行结果是()。public class Test{ public static void main(String args[]) {int a=4,

下列代码的执行结果是()。 public class Test { public static void main(String args[]) { int a=4,b=6,c=8; String s="abc"; System.out.println(a+b+s+c); System.out.println(); } }

A.ababcc

B.464688

C.46abc8

D.10abc8

点击查看答案
第6题
A 是抽象父类或接口, B , C(普通类) 派生自 A ,或实现 A ,现在 Java 源代码中有如下声明:1. A a0=new A(); 2. A a1 =new B(); 3. A a2=new C(); 问以下哪个说法是正确的

A.第1行不能通过编译

B.第1、2行能通过编译,但第3行编译出错

C.第1、2、3行能通过编译,但第2、3行运行时出错

D.第1行、第2行和第3行的声明都是正确的

点击查看答案
第7题
某企业12月份各损益类账户的余额如下: 主营业务收入3000000(贷)财务费用90000(借) 投资收益29000

某企业12月份各损益类账户的余额如下:

主营业务收入3000000(贷) 财务费用90000(借)

投资收益290000(贷) 营业费用180000(借)

其他业务收入220000(贷) 管理费用160000(借)

营业外收入25000(贷) 主营业务成本2300000(借)

主营业务税金及附加60000(借)

营业外支出125000(借)

其他业务支出120000(借)

要求:1.期末结转各账户余额,并编制会计分录。

2.根据上述资料,编制该企业12月份的利润表。 (假定所得税税率为25%,无纳税调整项目)

点击查看答案
第8题
选择题1.物料主数据,国外采购原物料的Valuation Class是()

A.1000

B.2111

C.2112

D.9000

点击查看答案
第9题
有如下程序: #include<iostream>usingnamespacestd; classTest{public: Test(){n+=2;}~Tes

有如下程序:

#include<iostream>

usingnamespacestd;

classTest

{

public:

Test(){n+=2;}

~Test(){n-=3;}

staticintgetNum(){returnn;}

private:

staticintn;

};

intTest::n=1;

intmain()

{

Test*p=neWTest;

deletep;

cout<<"n="<<Test::getNum()<<endl;

return0;

}

执行该程序的输出结果是()。

A.n=0

B.n=1

C.n=2

D.n=3

点击查看答案
第10题
最大似然估计求解过程正确的是()

.1.对数似然函数

class="markdown_return">.2.概率密度函数

.3.似然函数

class="markdown_return">.4.求导且令方程为0

.5.解方程

A.4-1-3-2-5

B.2-1-3-4-5

C.1-3-4-2-5

D.2-3-1-4-5

点击查看答案
第11题
In this part of the test, you are to write a short composition of about 120 to 150 words (

In this part of the test, you are to write a short composition of about 120 to 150 words (non-English majors) or 150 to 180 words (English majors) based on the idea given bellow.

Modem Life in the Modern World

1. 现代社会人们所享受到的高科技发展所带来的各种福利。

2. 高科技发展也给人们带来了种种难以承受的压力。

3. 不管怎么样,人类的前途是光明的。

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改