昆明理工大学java期末考试题背完必过

上传人:ali****an 文档编号:118766326 上传时间:2019-12-25 格式:DOC 页数:11 大小:514.50KB
返回 下载 相关 举报
昆明理工大学java期末考试题背完必过_第1页
第1页 / 共11页
昆明理工大学java期末考试题背完必过_第2页
第2页 / 共11页
昆明理工大学java期末考试题背完必过_第3页
第3页 / 共11页
昆明理工大学java期末考试题背完必过_第4页
第4页 / 共11页
昆明理工大学java期末考试题背完必过_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《昆明理工大学java期末考试题背完必过》由会员分享,可在线阅读,更多相关《昆明理工大学java期末考试题背完必过(11页珍藏版)》请在金锄头文库上搜索。

1、1在java中,数组的下标是从( )开始的。a. 以上说法都不对 b. 可以任意指定 c. 1 d. 0 1在Java中,n维数组只是n-1维数组的数组。对 错误 2数组说明时系统并不会创建数组,因此不能访问它的任何元素。对 错误 2若已有定义“String s=”This is ”;”,则执行语句“String t=s.concat(”String”);”后,t的内容为( )a. ”String” b. ”This” c. ”This is” d. ”This is String” 3若有数组说明“char s;”,则s为指向一个char型数组的引用变量。对 错误 4数组和Vector类都只

2、能保存同类型元素,但前者的长度一经定义后不再可变,而后者的长度可根据需要改变。对 错误 5要对数组进行排序,可采用的方法是( )a. binarySearch b. sort c. equals d. find 6要检测数组的元素个数,可以访问该数组类的成员变量( )a. size b. index c. elements d. length 7在Java中,数组引用的类型可以为它指向元素的子类。对 错误 8若intArray为整型数组,i为整型变量,则下列有关数组元素的访问方法中错误的是( )a. intArray0=12; b. intArrayi/2.0=8; c. intArray6*

3、i=5; d. intArrayi=3; 9在循环语句中,break可以立即结束当次循环而执行下一次循环。对 错误 10对于一个正数,执行算术右移“”后将仍是正数,但执行逻辑右移“”后有可能变为负数。对 错误 11以下运算符中,优先级最高的是( )a. = b. & c. () d. + 12下列程序的运行结果是( ) public class Test public static void main(String args) int a=5,b=1; boolean c=(a=2); System.out.println(b=+b+”,c=”+c); a. b=2,c=true b. b=1

4、,c=true c. b=2,c=false d. b=1,c=false 12下列表达式中,x的取值范围为0x100的表达式是( )a. x= (int)(Math.random()*100+0.5) b. x= (int)(Math.random()*100)+1 c. x= (int)(Math.random()*100) d. x= (int)(Math.random()*100+1) 13以下变量定义及其初始化语句中,错误的是( )a. char c=97; b. long bigval=6; c. int x= (int) (100L); d. float floatValue=1

5、2.4; 14 else子句总是与和它具有相同缩进格式的if语句配对。对 错误 15有关下列程序的执行结果,正确的说法是( ) public class Test public static void main(String args) int x=5,y=10; if(x5) System.out.println(x5); elseif(y10) System.out.println(x5&y10); else System.out.println(x=10); a. 编译报错 b. 输出x=10 c. 输出x5 d. 输出x5&y”后将仍是正数,但执行逻辑右移“”后有可能变为负数。对 错误

6、 19以下运算符中,优先级最高的是( )a. = b. & c. () d. + 20下列程序的运行结果是( ) public class Test public static void main(String args) int a=5,b=1; boolean c=(a=2); System.out.println(b=+b+”,c=”+c); a. b=2,c=true b. b=1,c=true c. b=2,c=false d. b=1,c=false 21下列表达式中,x的取值范围为0x100的表达式是( )a. x= (int)(Math.random()*100+0.5) b.

7、 x= (int)(Math.random()*100)+1 c. x= (int)(Math.random()*100) d. x= (int)(Math.random()*100+1) 22以下变量定义及其初始化语句中,错误的是( )a. char c=97; b. long bigval=6; c. int x= (int) (100L); d. float floatValue=12.4; 23 else子句总是与和它具有相同缩进格式的if语句配对。对 错误 24有关下列程序的执行结果,正确的说法是( ) public class Test public static void mai

8、n(String args) int x=5,y=10; if(x5) System.out.println(x5); elseif(y10) System.out.println(x5&y10); else System.out.println(x=10); a. 编译报错 b. 输出x=10 c. 输出x5 d. 输出x5&y”后将仍是正数,但执行逻辑右移“”后有可能变为负数。对 错误 28以下运算符中,优先级最高的是( )a. = b. & c. () d. + 29下列程序的运行结果是( ) public class Test public static void main(Strin

9、g args) int a=5,b=1; boolean c=(a=2); System.out.println(b=+b+”,c=”+c); 选择一个答案 a. b=2,c=true b. b=1,c=true c. b=2,c=false d. b=1,c=false 30下列表达式中,x的取值范围为0x100的表达式是( )选择一个答案 a. x= (int)(Math.random()*100+0.5) b. x= (int)(Math.random()*100)+1 c. x= (int)(Math.random()*100) d. x= (int)(Math.random()*10

10、0+1) 31以下变量定义及其初始化语句中,错误的是( )选择一个答案 a. char c=97; b. long bigval=6; c. int x= (int) (100L); d. float floatValue=12.4; 32 else子句总是与和它具有相同缩进格式的if语句配对。对 错误 有关下列程序的执行结果,正确的说法是( ) public class Test public static void main(String args) int x=5,y=10; if(x5) System.out.println(x5); elseif(y10) System.out.println(x5&y10); else System.out.println(x=10); a. 编译报错 b. 输出x=10 c. 输出x5 d. 输出x5&y10 34在for循环中,可以忽略初始化语句和循环迭代语句,但不能忽略作为条件判断的逻辑表达式。对 错误 36类类型的变量实际上是一个引用。对 错误

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号