题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-30 01:07:49

[单选题]下列代码的执行结果是: int numbers[]=new int[6]; for(int i=1;i<numbers.length;i++){ numbers[i] = i-1; System.out.print(numbers[i]+" "); }
A.0 1 2 3 4 5
B.1 2 3 4 5 6
C.0 1 2 3 4
D.1 2 3 4 5

更多"[单选题]下列代码的执行结果是: int numbers[]=new "的相关试题:

[单选题]执行完以下代码int[] x=new int[25];后,下列各项正确的是:()
A. x[24]为0
B.x[24]未定义
C.x[25]为0
D.x[0]为空
[单选题]下列代码的执行结果是 public class Test { public int aMethod() { static int i=0; i++; System.out.println(i); } public static void main(String args[]) { Test test = new Test(); test.aMethod(); } }
A.编译错误
B.0
C.1
D.运行成功,但不输出
[单选题]下面的代码段中,执行之后i 和j 的值是什么? ( )
Int i = 1;
Int j;
J = i++*2+3*--i;
A.1, 2
B.1, 5
C.2, 1
D.2, 2
[单选题]下列代码的执行结果是: int length = "Hello".length(); System.out.println(length);
A.5
B.2
C.10
D.6
[单选题]下面代码的输出结果为 int func(int x) { int countx =0; while(x) { countx ++; x = x&(x-1); } return countx; } int main() { cout<A.255
B.8
C.12
D.6
[单选题]为使下列代码正常运行,应该在下划线处填入的选项是:   int[] numbers=new int[n];   for(int i=0;iA.size
B.length
C.dimension
D.measurement
[单选题]下列代码段中,循环执行的次数是:()
int x = 10;
do {
x--;
} while (x <=5);
A.10次
B.0次
C.1次
D.超过10次
[单选题]执行下列代码,程序的输出结果是(用下划线表示空格):( ) int a=29,b=100; cout <A.29_100
B._29_100
C.29100
D._29100
[判断题]int[] arr = new int[5];该数组的长度是5。
A.正确
B.错误
[多选题] 下面代码实现了ListView的数据,请补全代码()?private int[] iPic = {R.drawable.door, R.drawable.lib, R.drawable.science, R.drawable.rest, R.drawable.lake, R.drawable.medium, R.drawable.night}; private String[] strName = {"大门", "图书馆", "科技楼", "宿舍楼", "天鹅湖", "体育场", "夜景"}; private String[] strContent = {"美丽大运村", "美丽图书馆", "美丽科技楼", "美丽宿舍楼", "美丽天鹅湖","美丽体育场", "美丽夜景"}; private ArrayList> mArrayList; private void initData() { mArrayList=new ArrayList<>(); for (int i=0;i map=new HashMap<>(); ( ? ) mArrayList.add(map); }
A.map.put("image",iPic[i]);
B.map.put("name",strName[i]);
C.map.put("content",strContent[i]);
D.map.put("person",strPerson[i]);
[多选题]下面代码实现了ListView的数据,请补全代码()?private int[] iPic = {R.drawable.door, R.drawable.lib, R.drawable.science, R.drawable.rest, R.drawable.lake, R.drawable.medium, R.drawable.night}; private String[] strName = {"大门", "图书馆", "科技楼", "宿舍楼", "天鹅湖", "体育场", "夜景"}; private String[] strContent = {"美丽大运村", "美丽图书馆", "美丽科技楼", "美丽宿舍楼", "美丽天鹅湖","美丽体育场", "美丽夜景"}; private ArrayList mArrayList; private void initData() { mArrayList=new ArrayList<>(); for (int i=0;iA.mItemBean.setiPic(iPic[i]);
B.mItemBean.setStrName(strName[i]);
C.map.put("content",strContent[i]);
D.mItemBean.setStrContent(strContent[i]);
[单选题]int[] arr=new int[5]{1,2,3,4,5},该数组的长度()
A.5
B.2
C.4
D.1
[单选题]请阅读下列代码:protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE://标志符 if (resultCode == RESULT_OK) { strReturnData = data.getStringExtra("password"); mTextView2.setText("第二个Activity传回的password:" + strReturnData); } break; default: }}。onActivityResult的作用是什么()?
A.处理第一个Activity的运行数据
B.处理第一个Activity传递给第二个Activity的运行数据
C.处理第二个Activity的运行数据
D.处理第二个Activity传回给第一个Activity的运行数据
[单选题]阅读下列代码 public class Person{ static int arr[ ] = new int[10]; public static void main (String[] args) { System.out.println(arr[9]); } } 该代码运行的结果是:
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出0
D.输出空
[单选题]下面代码执行结果为() class A { public: void B() { cout<<"want func ptr"; } }; int main() { void (A::*func)() = &A::B; A a; (a.*func)(); return 0; }
A.want func ptr
B.编译错误,A类中没有成员*func函数
C.没有任何输出
D.不能A::B取地址
[单选题]给出下面代码:
Public class Person{
Static int arr[] = new int[10];
Public static void main(String a[])
{
System.out.println(arr[1]);
}
}
哪个语句是正确的? ( )
A.编译时将产生错误;
B.输出零;
C.编译时正确,运行时将产生错误;
D.输出空。
[单选题]阅读下马代码,运行结果为() class cls { public: int mi ; cls(int i):mi(i) { mi = i; cout<A.1
B.2
C.3
D.未知
[判断题] 在VB中,计时器(Timer)定期激活Timer事件,使Timer中的代码执行一次.
A.正确
B.错误
[单选题]若变量a是int类型,并执行了语句:a= 'A+1.6;,则正确的叙述是( )
A.a的值是字符C
B.a的值是浮点型
C. 不允许字符型和浮点型相加
D.a的值是字符'A‘的ASCII值加上1。

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码