101、若需要定义一个类域或类方法,应使用哪种修饰符?()
A、static
B、package
C、private
D、public
答案:A
102、下面代码执行后的输出是什么()
package com.bjsxt;
public class Test {
public static void main(String[] args) {
outer: for (int i = 0; i < 3; i++)
inner: for (int j = 0; j < 2; j++) {
if (j == 1)
continue outer;
System.out.println(j + " and " + i);
}
}
}
A、
0 and 0
0 and 1
0 and 2
B、
1 and 0
1 and 1
1 and 2
C、
2 and 0
2 and 1
2 and 2