近期看了一些选择题(2)

您所在的位置:网站首页 下面关于jvm内存说法错误的是 近期看了一些选择题(2)

近期看了一些选择题(2)

2024-07-06 11:27| 来源: 网络整理| 查看: 265

36-40:D C CD C B 36.下面关于JAVA的优点说法错误的是? A、JAVA是纯面向对象的语句,还有众多的API支持,所以JAVA开发各种各样的应用 程序变的非常容易且易于维护。 B、JAVA使用的是Unicode作为标准字符,这使得JAVA程序在不同的语言平台上都能 被编译和运行。 C、JAVA引进来的EXCEPTION处理机制,使得JAVA程序更安全、更稳定、更随机应变 D、垃圾回收机制是JAVA的内在特性,垃圾回收机制的调度是有程序员负责的

37.下面关于JVM说法不准确的是? A、 JVM目前已有针对不同的平台开发了多个相应的版本。 B、所以的JAVA程序编译成字节码后都需要被调度到相应版本的JVM中才能执行。 C、各个版本的JVM对内存的管理都是通过GC机制实现的 D、JVM机制的引入才使我们的程序很容易的动态内存管理及多线程、JavaBean等服务。

38.下面关于JDK工具的说法不正确的?(复选题)  A、我们可以通过JAVAC工具实现对JAVA程序的编译并能通过-d参数指定字节码文件   的位置。  B、-classpath无论对java及javac工具都有引进其它类的作用。  C、javadoc工具可以把我们程序用所有注释部分自动生成html文档.  D、appletview工具可以用来运行我们的applet小程序。

39.下面关于int在java程序中长度的说法精确的是?  A、1 bytes  B、2 bytes  C、4 bytes  D、8 bytes 40.下面代码中那一个不能够创建一个数组?  A 、float []f[] = new float[6][6];  B 、float f[][] = new float[][6];  C、float [][]f = new float[6][6];  D、float [][]f = new float[6][];

41-50:A B C C AD C C C BD ABD 41.给出如下声明? String s1=new String(“Hello”); String s2=new String(“there”); String s3=new String(); 下列选现中( )是合法的  A、s3 = s1 + s2 B、s3 = s1 – s2 C、s3 = s1 & s2 D、s3 = s1 && s2

42.给出下面代码段: boolean m = true; if(m = false) System.out.println(“False”); else System.out.println(“True”);运行的结果是? ( )  A 、False B、True  C、 None D、 An error will occur when running

43.下面的程序编译运行的结果是:   public class Something {   public static void main(String[] args) { Other o = new Other(); new Something().addOne(o); } public void addOne(final Other o) {    o.i++;    }   }   class Other {    public int i;   } A、编译时出错 B、运行时出错 C、正确运行

44.下面代码如何使成员变量m 被函数fun()直接访问? class Test{   private int m;   public static void fun() {     // some code̷   } } A、将private int m 改为protected int m B、将private int m 改为 public int m C、将private int m 改为 static int m D、将private int m 改为 int m4

45.面哪几个函数是public void example(){̷}的重载函数?(复选题) public void example( int m){̷} public int example(){̷} public void example2(){̷} public int example ( int m, float f){̷}

46.下面的代码段中,执行之后i 和j 的值是什么? int i = 1; int j; j = i++; A、1, 1 B、1, 2 C、2, 1 D、2, 2

47.已知如下的命令执行 java MyTest a b c请问哪个语句是正确的? A、args[] = ̶MyTest a b c” B、args[] = ̶MyTest” C、args[] = ̶a” D、args[1]= ‘b’

48.如下代码正确的结果是: public class Test { long a[] = new long[1]; public static void main ( String arg[] ) { System.out.println ( a[6] ); } } 没有输出 输出 编译时出错 运行时出错

49.下面代码输出的结果是:(复选题) public class Test { public static void main(String arg[]) { int i = 5; do { System.out.println(i); } while (–i>5) System.out.println(̶finished”); } } 结果: 4 5 6 finished

50.在如下源代码文件Test.java中, 哪个是正确的类定义?(复选题) public class test { public int x = ; public test(int x) { this.x = x; } }public class Test{   public int x=;   public Test(int x) {   this.x = x;   }   }public class Test extends T1, T2 {   public int x = ;   public Test (int x) {   this.x = x;   }   }public class Test extends T1{   public int x=;   public Test(int x){   this.x = x;   }   }    51-60 :B B D B A BC B D D CD 51.class J_Test{ public static void main(String args[]) { int i= 99; mb_operate(i); System.out.print(i+1); } // End of method: main static void mb_operate(int i) { i+=1; } // End of method: mb_ operate } // End of class: J_Test 上面程序的输出是什么? ( )  A、 99 B、 199 C、 299 D、 991

52.下面代码运行的结果是:   String s = new String(̶Bicycle”);   int iBegin = 1;   char iEnd = 3;   System.out.println(s.substring(iBegin, iEnd));  A、Bic  B、ic  C、icy  D、error:no method matching substring(int,char)    53.class J_StringBuffer{ public static void main(String args[]){ StringBuffer a = new StringBuffer(̶A”); StringBuffer b = new StringBuffer(̶B”); mb_operate(a, b); System.out.println(a + ̶.” + b); } // End of method: mainstatic void mb_operate(StringBuffer x, StringBuffer y){ x.append(y); y=x; } // End of method: mb_operate   } // End of class: J_StringBuffer   上面程序的输出是什么?  A、A.B  B、A.A  C、AB.AB  D、AB.B

54.认真阅读下段例程,

class Super{public float getNum(){return 3.f;}}public class Sub extends Super{} 下面语句,哪句放在第6行会引起编译错误?  A、public float getNum(){return 4.f;}  B、public void getNum(){}  C、public void getNum(double d){}  D、public double getNum(float d){return 4.d;}

55.在Q2_2类哪个是合法的覆盖(override)? public clsss Q2_1 { public void method(int k){}; } class Q2_2 extends Q2_1 { } A、public void method(int i){}; B、public void method(int j,int k){} C、public float method(int k){}; D、private void method(int k){};

56.在Q2_2类中下面选项哪个没有形成合法的覆盖(override)? (复选题) public class Q2_1 { protected void method(int k ,char c){}; } class Q2_2 extends Q2_1 { } A、public void method(int i,char c){} B、public void method(char c, long n){} C、public float method(int k,char c){return 3.2F;} D、protected void method(int k,char c){}

57.下面的类中,哪个不是合法的重载(overload)? public class Q1 { public void method(int i){} } A、private void method(int i,int j){} B、public void method(int k){} C、private float method(float f){} D、public String method(int i,int j){} E、public float method(float f){}

58.看下面的代码,选择正确的结论: class SuperClass { int i=8 ; SuperClass() { add(1); } void add(int j) { i=i+j; } } class SubClass extends SuperClass {   int i=8; void add(int j) { i=i+2*j; } } public class MainClass { public static void main(String args[]) { SuperClass a=new SubClass(); System.out.println(a.i); } }  A 、编译时出现错误 B、运行时出现错误  C、输出 1 D、输出 8

59.阅读以下例程, int i=1,j=1; do{ if(i++>–j) continue; }while(i



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3