已选分类
工学计算机科学与技术
不定项选择题给出下面的代码片断: 1)public void create(){ 2)Vector myVect; 3)myVect=new Vector(); 4)} 下面陈述为true(真)的是______。 A.第二行的声明不会为变量myVect分配内存空间 B.第二行的声明分配一个到Vector对象的引用的内存空间 C.第二行语句创建一个Vector类对象 D.第三行语句创建一个Vector类对象 E.第三行语句为一个Vector类对象分配内存空间
不定项选择题给出下面的类: public class Sample{ long length; public Sample(long 1){length=1;} public static void main(String arg[]){ Sample s1,s2,s3; s1=new Sample(21L); s2=new Sample(21L); s3=s2; long m=21L; } } 下面表达式返回true的是______。 A.s1==s2; B.s2==s3; C.m==s1;D.s1.equals(m);
不定项选择题变量result是一个boolean型的值,下面的表达式合法的是______。 A.result=true; B.if(result){//do something…}; C.if(result!=0){//so something…}; D.result=1;
不定项选择题给出下面的代码: public class Person{ static int arr[] =new int[10]; public static void main(String a[]) { System.out.println(arr[1];) } } 以下叙述对的是______。 A.编译时将发生错误 B.编译时正确但是运行时出错 C.输出为0 D.输出为null
不定项选择题有以下程序: 1)class Person { 2)public void printValue(inti, int j) {/*…*/ } 3)public void printValue(int i){/*…*/} 4)} 5)public class Teacher extends Person{ 6)public void printValue() {/*…*/} 7)public void printValue(int i){/*…*/} 8)public static void main(String args[]){ 9)Persorn t=new Teacher(); 10)t.printValue(10); 11)} 12)} 第10行的声明将调用的方法______。 A.on line 2 B.on line 3 C.on line 6 D.on line 7
不定项选择题给出以下语句: class Parent{ String one,two; public Parent(String a,String b){ one=a; two=b; } public void print(){System.out.println(one);} } public class Child extends Parent{ public Child(String a,String b){ super(a,b); } public void print(){ System.out.println(one+to+two); } public static void main(String arg[]){ Parent P=new Parent(south,north); Parent t=new Child(east,west); P.print(); t.print(); } } 下面的运行结果中正确的是______。 A.在编译时出错 B.south east C.south to north east to west D.south to north east E.south east to west
不定项选择题哪些有关线程的叙述是对的? A.一旦一个线程被创建,它就立即开始运行 B.使用start()方法可以使一个线程成为可运行的,但是它不一定立即开始运行 C.当一个线程因为抢先机制而停止运行,它被放在可运行队列的前面 D.一个线程可能因为不同的原因停止(cease)并进入就绪状态
不定项选择题下面的______关键字通常用来对对象加锁,该标记使得对对象的访问是排它的。 A.transient B.synchronized C.serialize D.static
不定项选择题Which statement of assigning a long type variable to a hexadecimal value is correct? A.long number = 345L; B.long number = 0345; C.long number = 0345L; D.long number = Ox345L
不定项选择题Which of the following range of short is correct? A.-27~27-1 B.0~216-1 C.215~215-1 D.231~231-1
不定项选择题给出以下语句: String s=hello; String t=hello; char c[]={h,e,l,l,o}; 以下语句返回true的是______。 A.s.equals(t); B.t.equals(c); C.s==t;D.t.equals(new String(hello)); E.t==c;
不定项选择题Which are not Java keywords? A.TRUE B.sizeof C.const D.super E.void
不定项选择题给出下面的代码: 1)public Void modify() { 2)int i, j, k; 3)i=100; 4)while ( i>0 ) { 5)j=i*2; 6)System.out.println (The value of j is+j ); 7)k=k+ 1; 8)i--; 9)} 10)} 第______行在编译时可能产生错误。 A.4 B.6 C.7 D.8
不定项选择题给出下面的代码: public class Test { Void printValue(int m){ do{ System.out.printIn(The Value is+m); } while(--m>10) } public static void main(String arg[]) { int i=10; Test t=new Test(); t.printValue(i); } } 输出将是______。 A.The value is 8 B.The value is 9 C.The value is 10 D.The value is 11
不定项选择题在Java API文档中______被包括在内。 A.类及用途的描述 B.父类的方法的列表 C.成员变量的列表 D.类层次
不定项选择题Which of the following statements about variables and their scopes are true? A.Instance variables are member variables of a class B.Instance variables are declared with the static keyword C.Local variables defined inside a method are created when the method is executed D.Local variables must be initialized before they are used
不定项选择题下面关于继承的叙述正确的是______。 A.在Java中只允许单一继承 B.在Java中一个类只能实现一个接口 C.在Java中一个类不能同时继承一个类和实现一个接口 D.Java的单一继承使代码更可靠
不定项选择题Which of the following statements are true? A.The equals() method determines if reference values refer to the same object B.The == operator determines if the contents and type of two separate objects match C.The equals() method returns true only when the contents of two objects match D.The class File overrides equals() to return true if the contents and type of two separateobjects match
不定项选择题线切割加工编程时,计数长度应( )。 A.以μm为单位 B.以mm为单位 C.写足4位数 D.写足5位数 E.写足6位数
不定项选择题FilterOutputStream类是BufferedOutputStream、DataOutputStream和PrintStream的父类。下列______类是FilterOutputStream类构造符的参数. A.InputStream B.OutputStream C.File D.RandomAccessFile E.StreamTokenizer
