Core Java 技能题,Core_Java考试题2.doc

Core_Java考试题2

班级: 姓名: 日期:试题

选择填空题:全部为多选题,只有全部正确才能得分。

“e” B.’f’ C. ‘\u12’ D.’\u0012’

byte变量的取值范围是________。

A. 0 - 65535 B.-128 – 127 C.-256 – 255 D.0 - 32767

以下正确的有________。

A. int i = 32; B.float f = 45.32; C. double d=3.2;

以下返回true的表达式有________。

A. “george” == “george” B.”george” = “george”

C. “george”.equals(new String(“george”)) D. “george” == new String(“george”)

根据以下程序选择正确答案________:

public class Test {

static int total = 10;

public static void main (String args []) {

new Test();

}

public Test () {

System.out.println("In test");

System.out.println(this);

int temp = this.total;

if (temp > 5) {

System.out.println(temp);

}

}

}

A. 编译出错 B.运行时有异常 C. 编译运行都正确

下面集合定义正确的有________。

A. String strs[] = { ‘a’ ‘b’ ‘c’};

B. String[] strs = {“a”, “b”, “c”};

C. String[] strs = new String{“a” ,”b”, ”c”};

D.String strs[] = new String[]{“a”, “b”, “c”};

E.String[] strs = new String[3]{“a”, “b”, “c”};

分别使用for, while, do/while循环实现从1到100的累加。

for

while

3) do-while

以下switch表达语句正确的有________。

public void switchTest(char c){

switch(c){…}

}

public void switchTest(long c){

switch(c){…}

}

public void switchTest(byte c){

switch(c){…}

}

public void switchTest(double c){

switch(c){…}

}

在面向对象编程中,一个类型由________、________和________组成。面向对象的特性包括________、________和________。在java中访问权限的限制由严格到宽松依次是________、________、________和________。

A.public B.protected C.identifierD.data

E.privateF.operationsG.inheritanceH.default(no modifier)

I.encapsulation J.polymorphism

以下方法申明正确的有________________。

A.public static synchronized void writeLog(String msg)

B. synchronized public static writeLog(String msg)

C. public final abstract void writeLog(String msg)

D.final public void writeLog(String msg)

E.abstract synchronized void writeLog(String msg)

Java方法的参数传递对于基本数据类型如int, byte等,参数传递是________;对自定义数据类型,参数传递是________。

A. by reference B.by pointer

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值