C、continue语句可以在循环语句中使用 D、不输出任何内容
154、下面选项中,哪个关键字可以修饰局部变量?() A、abstract B、final C、static D、private
155、public class Example {
public static void main(String[] args) { try{
int rst = 4/0;
System.out.println(\ }catch(Exception e){
System.out.println(\语句块执行\ return; }finally{
System.out.println(\语句块执行\ }
System.out.println(\程序继续向下执行\ } }
运行以上程序,输出的结果是( ) A、catch语句块执行
B、catch语句块执行 程序继续向下执行 C、catch语句块执行 finally语句块执行 D、0 程序继续向下执行 156、请阅读下面的程序 public class Example03 {
public static void main(String[] args) { int x = 8; if (x > 5) {
System.out.println(\ } else {
System.out.println(\
} } }
程序的运行结果是?() A、true B、false C、a D、b
157、当成员变量和局部变量重名时,若想在方法内使用成员变量,那么需要使用下列选项中的哪一个关键字( )。 A、super B、import C、this D、return
158、下列关于Java语言的描述中,错误的是?() A、Java语言是一门面向对象的编程语言 B、Java是一门与平台无关的编程语言
C、Java具有JavaSE、JavaME和JavaEE三大平台 D、Java是一门介于汇编和高级之间的语言 159、下面关于字符变量的定义中,错误的是( ) A、char a='a'; B、char b=97; C、char c=0x61; D、char d=A;
160、下列关于continue语句的说法中,正确的是
A、continue语句可以在选择语句中使用 B、continue语句可以在条件语句中使用 C、continue语句可以在循环语句中使用 D、continue语句可以在任何语句中使用 161、请阅读下面的程序片段 int x = 1, y = 1;
if (x++ == 2 & ++y == 2) { x = 7; }
System.out.println(\程序的运行结果是( ) A、x=1,y=1 B、x=7,y=1 C、x=7,y=2 D、x=2,y=2
162、下列方法中,哪个方法可以返回指定日历字段的值?() A、void add(int field,int amount) B、void set(int field,int value) C、int get(int field)
D、void set(int year,int month,int date) 163、下了关于接口继承的说法中,正确的是?() A、接口继承自Object类 B、一个接口只能继承一个接口 C、一个接口可以继承多个接口 D、接口不能被继承
164、float类型成员变量的默认初始化值是( )。
A、0 B、false C、null D、0.0F
165、分析下面程序,哪一行代码能正确赋值?() class Demo {
public void method() {
final int num1 = 10; static int num2 = 20; abstract int num3 = 30; private int num4 = 40; } }
A、final int num1 = 10; B、static int num2 = 20; C、abstract int num3 = 30; D、private int num4 = 40;
166、下列关于条件语句的描述,错误的是( ) A、if语句中的条件表达式是一个布尔值 B、选择语句分为if条件语句和switch条件语句 C、switch语句中的表达式只能是布尔类型的值 D、switch语句只能针对某个表达式的值作出判断
167、下列选项中,按照箭头方向,不可以进行自动类型转换的是 A、byte → int B、int → long C、double →long D、short → int
168、下列选项中,按照箭头方向,需要进行强制类型转换的是 A、double ← float B、float ← long C、int ← char D、char ←byte
169、Calendar类中,用于为指定的日历字段增加或减去指定的时间量的方法是?(A、int get(int field)
B、void add(int field,int amount) C、void set(int field,int value)
D、void set(int year,int month,int date) 170、请阅读下面的程序 Public class Test {
public static void main(String[] args) { int a = 0; int b = 0;
for (int i = 1; i <= 5; i++) { a = i % 2;
while (a-- >= 0) { b++; } }
System.out.println(\} }
下列选项中,哪一个是正确的运行结果( ) A、a=8,b=-2 B、a=-2,b=8 C、a=3,b=0 D、a=0,b=3
171、下列关于继承的描述中,错误的是()
)