JAVA中在某游戏系统有猫狗猪_java期末复习题 (1)

本文是一份JAVA编程相关的游戏系统复习资料,涵盖了继承、运算符、类型转换等知识点的选择题解析,帮助理解JAVA面向对象特性及基本语法。
摘要由CSDN通过智能技术生成

一、单项选择题

1.关于继承以下陈述正确的是( D )

A. "X extends Y" is correct if and only if X is a class and Y is an interface.

B. "X extends Y" is correct if and only if X is an interface and Y is a class.

C. "X extends Y" is correct for all combinations of X and Y being classes and/or

interfaces.

D. "X extends Y" is correct if X and Y are either both classes or both interfaces.

2.运行第一行和第二行代码后,x、a、b的值正确的是( C )

1. int x, a=6,b=7;

2. x=a++ + b++;

A. x=15,a=7,b=8

B. x=15,a=6,b=7

C. x=13,a=7,b=8

D. x=13,a=6,b=7

3.表达式(13+3*4)/4%3的值是 ( A )

A. 0

B. 25

C. 2

D. 1

4.在JAVA程序中import、class和package的正确出现顺序是 ( C )

A. class,import,package

B. package,class,import

C. package,import,class

D. import,package,class

5.某一程序的main方法中有如下语句,则输出的结果是 ( B )

string s1=“0.5”,s2=“12”;

double x = Double.parseDouble(s1);

int y = Integer.parseInt(s2);

System.out.println(x+y);

A. 12

B. 12.5

C. 120.5

D. “12.5”

6.定义整数数组x:

int[] x=new int[25];

关于x的描述正确的是 ( D )

A. x[24] is undefined.

B. x[25] is 0

C. x[0] is null

D. x.length is 25

7.下列不属于面向对象编程的三个特征的是(B )

A.封装

B.指针操作

C.多态性

D.继承

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值