java入学测试_java入学测试题.doc

java入学测试题

传智播客java就业班入学测试题

共50道题,每道题2分,总分100分,80分为合格。

注意,题目有多选,也有单选。请认真作答。

在JAVA中,下列哪些说法是正确的( )

A.java源文件的扩展名为.java

B.写好的java源程序可以直接运行

C.编写的源程序必须先编译后才能运行

D.程序员可以读懂扩展名为.class的文件

下列标识符哪个是合法的( )

A.class

B.$abc

C.1234

D._name

下面哪些赋值语句是正确的?( )

A. long test = 012;

B. float f = -412;

C. int other = (int) true;

D. double d = 0

E. byte b = 128;

在Java中,下列语句不能通过编译的有( )

A. String s= “join”+ 3;

B. int a= “join”+3;

C. int a= ‘a’+5;

D. float f=5+5.5;

设 a = 3,则表达式 (--a )<

A. 16

B. 8

C. 24

D. 12

下列代码运行的结果是( )

public static void main(String[] args) {

int x = 4;

int y = 5;

if(x++>4 & ++y>5) {

x++;

}

System.out.println("x=" + x + ",y=" + y);

}

A. x=4,y=5

B. x=4,y=6

C. x=5,y=6

D. x=6,y=6

尝试运行下面的代码会发生什么?( )

public class Test {

public static void main(String[] args) {

boolean m = true;

if (m = false) {

System.out.println("true");

} else {

System.out.println("false");

}

}

}

A. 输出字符串”true”

B. 输出字符串”false”

C. 编译时错误

D. 运行时错误

编译并运行以下代码将发生什么? ( )

public static void main(String args[]){

char digit = 'a';

for (int i = 0; i < 10; i++){

switch (digit)

{

case 'x' :

{

int j = 0;

System.out.println(j);

}

default :

{

int j = 100;

System.out.println(j);

}

}

}

int i = j;

System.out.println(i);

}

A. 输出11次100

B. 输出10次100,然后抛出运行期异常

C. 编译错误,因为变量i不能在main() 方法中被声明2次

D. 编译错误,因为变量j不能在main() 方法中被声明2次

E. 以上都不对

class Demo

{

public static int fun(int c)

{

return c+=2;

}

public static void main(String[] args)

{

int temp = fun(2);

System.out.println(temp);

}

}

A. 2

B. 4

C. 6

D. 8

下面哪些函数是public void aMethod(){...}的重载函数?( )

A. void aMethod( ){...}

B. public int aMethod(int a, float b){...}

C. public void aMethod (){...}

D. public float aMethod (int m){…}

在java中,关于数组描述正确的是( )

A.数组中的索引下标从1开始

B.存储在数组当中的数据都属于同一数据类型

C.通过数组名.length()能获得数组的

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值