好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

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

13页
  • 卖家[上传人]:re****.1
  • 文档编号:484271536
  • 上传时间:2023-08-24
  • 文档格式:DOC
  • 文档大小:584.50KB
  • / 13 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 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类都只能保存同类型元素,但前者的长度一经定义后不再可变,而后者的长度可根据需要变化对 错误 5要对数组进行排序,可采用的措施是( )a. binarySearch b. sort c. equals d. find 6要检测数组的元素个数,可以访问该数组类的成员变量( )a. size b. index c. elements d. length 7在Java中,数组引用的类型可觉得它指向元素的子类对 错误 8若intArray为整型数组,i为整型变量,则下列有关数组元素的访问措施中错误的是( )a. intArray[0]=12; b. intArray[i/2.0]=8; c. intArray[6*i]=5; d. intArray[i]=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<10)||(++b>=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 12下列体现式中,x的取值范畴为0≤x≤100的体现式是( )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=12.4; 14 else子句总是与和它具有相似缩进格式的if语句配对。

      对 错误 15有关下列程序的执行成果,对的的说法是( ) public class Test {     public static void main(String args[]) {         int x=5,y=10;         if(x>5)             System.out.println("x>5");        elseif(y<10)            System.out.println("x<5&&y<10");        else           System.out.println("x<5&&y>=10"); } }a. 编译报错 b. 输出x<5&&y>=10 c. 输出x>5 d. 输出x<5&&y<10 16在for循环中,可以忽视初始化语句和循环迭代语句,但不能忽视作为条件判断的逻辑体现式对 错误 类类型的变量事实上是一种引用对 错误 17在循环语句中,break可以立即结束当次循环而执行下一次循环对 错误 18对于一种正数,执行算术右移“>>”后将仍是正数,但执行逻辑右移“>>>”后有也许变为负数对 错误 19如下运算符中,优先级最高的是( )a. >= b. && c. () d. + 20下列程序的运营成果是( ) public class Test {      public static void main(String args[]) {          int a=5,b=1;          boolean c=(a<10)||(++b>=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的取值范畴为0≤x≤100的体现式是( )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) 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 main(String args[]) {         int x=5,y=10;         if(x>5)             System.out.println("x>5");        elseif(y<10)            System.out.println("x<5&&y<10");        else           System.out.println("x<5&&y>=10"); } } a. 编译报错 b. 输出x<5&&y>=10 c. 输出x>5 d. 输出x<5&&y<10 25 在for循环中,可以忽视初始化语句和循环迭代语句,但不能忽视作为条件判断的逻辑体现式对 错误 类类型的变量事实上是一种引用对 错误 第三部分26在循环语句中,break可以立即结束当次循环而执行下一次循环对 错误 27对于一种正数,执行算术右移“>>”后将仍是正数,但执行逻辑右移“>>>”后有也许变为负数对 错误 28如下运算符中,优先级最高的是( )a. >= b. && c. () d. + 29下列程序的运营成果是( ) public class Test {      public static void main(String args[]) {          int a=5,b=1;          boolean c=(a<10)||(++b>=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的取值范畴为0≤x≤100的体现式是( )选择一种答案 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) 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(x>5)             System.out.println("x>5");        elseif(y<10)            System.out.println("x<5&&y<10");        else           System.out.println("x<5&&y>=10"); } } a. 编译报错 b. 输出x<5&&y>=10 c. 输出x>5 d. 输出x<5&&y<10 34在for循环中,可以忽视初始化语句和循环迭代语句,但不能忽视作为条件判断的逻辑体现式对 错误 36类类型的变量事实上是一种引用对 错误 。

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.