国开在线答案
-
2022-09-12
[单选] public class XXK2 {
private int a,b;
public XXK2(int aa, int bb) {a=aa; b=bb;}
public int f1(int x) {
if(x>10) return a+b+3*x;
else return a*b*x;
}
public static void main(String[] args) {
XXK2 x=new XXK2(3,4);
int y=x.f1(8);
System.out.println("y="+y);
}
}
-
2022-09-12
[单选] public class XXK4 {
public static void main(String[] args) {
int []a={2,5,8,10,15,20};
int s=0;
for(int i=0; i<a.length; i++) s+=a[i];
System.out.println("s="+s);
}
}
-
2022-09-12
[单选] public class XXK4 {
public static void main(String[] args) {
String []a={"xxk","weirong","xucong","xuxiaohua","baojuan"};
int m=0;
for(int i=0; i<a.length; i++) {
int n=a[i].length();
if(n>m) m=n;
}
System.out.println("m="+m);
}
}
-
2022-09-12
[判断] 数组的大小自创建以后就固定了。如果需要在序列中存储不同类型的数据,或者需要动态改变其大小,就需要用集合类型,如Vector类。
-
2022-09-12
[判断] 所有集合类都位于java.util包下。
-
2022-09-12
[判断] 集合框架是为表示和操作集合而规定的一种统一的标准体系结构,包含三大块内容:接口、实现和算法。
-
2022-09-12
[判断] Set 接口继承 Collection接口,“无序不可重复”,即Set是无序集合,集合中的元素不可以重复。List 接口也继承 Collection接口,“有序可重复”,允许重复,即List是有序集合,集合中的元素可以重复。
-
2022-09-12
[判断] Map接口是键-值对象,即Map中保存Key-value对形式的元素,访问时只能根据每项元素的key来访问其value。key不能重复,value可以重复。
-
2022-09-12
[判断] 数组的长度不能够被改变,而向量类(Vector)对象的长度可以被改变。
-
2022-09-12
[判断] 向量类Vector中的add(x)方法能够把x元素加入到当前对象的末尾。
- 首页
- 上一页
-
6850
-
6851
-
6852
-
6853
-
6854
-
6855
-
6856
-
6857
- 下一页
- 尾页