首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列语句能给数组赋值而不使用for循环的是
下列语句能给数组赋值而不使用for循环的是
admin
2009-08-24
31
问题
下列语句能给数组赋值而不使用for循环的是
选项
A、myArray{[1]="One";[2]="Two";[3]="Three";}
B、String s[5]=new String[]{"Zero", "One", "Two", "There", "Four"};
C、String s[]=new String[]{"Zero", "One", "Two", "There", "Four"};
D、String s[]=new String[]=|"Zero", "One", "Two", "There", "Four"};
答案
C
解析
A)、D)语法不正确,B)中s[5]的形式只能通过for循环的格式进行赋值,而不能直接赋值。C)中表达式左侧的“[]”说明现在定义一个数组,不需要指明数组长度,而表达式右侧“[]”在后面直接紧跟初始内容时也是不需要指定数组大小的,数组大小直接由初值长度决定。
转载请注明原文地址:https://kaotiyun.com/show/V0np777K
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
在软件设计中不使用的上具是
在建立表间一对多的永久联系时,主表的索引类型必须是
假设职员表已在当前工作区打开,其当前记录的“姓名”字段值为“李彤”(C型字段)。在命令窗口输入并执行如下命令:姓名=姓-’’出勤’’?姓名屏幕上会显示
下列排序方法中,最坏情况下比较次数最少的是
对长度为10的线性表进行冒泡排序,最坏情况下需要比较的次数为
如果一个过程不包含RETURN语句,或者RETURN语句中没有指定表达式,那么该过程:
在查询设计器的工具栏中有、而在视图设计器中没有的工具按钮是
在VisualFoxPro中,为了将菜单作为顶层菜单,需要设置表单的某属性值为2,该属性是
运算结果不是2015的表达式是
对软件是否能达到用户所期望的要求的测试称为()。
随机试题
大多数细胞产生静息电位的原因是
组成蛋白质的主要元素不包含下列哪种元素
全部由浆液性腺泡组成,故属纯浆液腺的是
下列与核酸的合成密切相关的代谢途径是
腹膜透析患者出量每日为多少以上时可正常量饮水()
为病人做口腔护理时宜对下列()进行评估。
根据《合同法》的规定,投标文件是( )。
库存现金限额由开户银行根据开户单位5~7天的日常零星开支所需要的现金核定。()
在下行文中提出执行要求时,要使受文者不折不扣执行文件,应写作()。
设A="345678",则表达式Val(Mid(A,4,2)+Right(A,4))的值为______。
最新回复
(
0
)