当前分类: SCJP程序员认证考试
问题:public class SyncTest{ public static void main(String args...
查看答案
问题:package test; class Target { public String name = “hello”;...
问题:public class Test { public static void add3 (Integer i) { ...
问题:Which two valid declarations of a char? ()...
问题:What is the result?()...
问题:Which two code fragments are most likely to cause a StackOve...
问题:单选题public class test ( public static void main(string args) { int 1= 0; while (i) { if (i==4) { break; } ++i; } } ) What is the value of i at line 10?()A 0B 3C 4D 5E The code will not compile....
问题:多选题Which two CANNOT directly cause a thread to stop executing?()ACalling the yield method.BCalling the wait method on an object.CCalling the notify method on an object.DCalling the notifyAll method on an object.ECalling the start method on another Thread ...
问题:10. interface A { void x(); } 11. class B implements A { pu...
问题:多选题Which two valid declarations of a char?()AChar ch = “a”;BChar ch = ‘/’ ‘;CChar ch = ‘cafe’;DChar ch = “cafe”;EChar ch = ‘/ucafe’;FChar ch = ‘/u10100’;GChar ch = (char) true;...
问题:单选题Which of the following range of short is correct?()A -27 -- 27-1B 0 -- 216-1C -215 -- 215-1D -231 -- 231-1...
问题:单选题public class Threads5 { public static void main (String[] args) { new Thread(new Runnable() { public void run() { System.out.print(”bar”); } }).start(); } } What is the result?()A Compilation fails.B An exception is thrown at runtime.C The c...
问题:多选题You need to store elements in a collection that guarantees that no duplicates are stored. Which two interfaces provide that capability?()AJava.util.MapBJava.util.SetCJava.util.ListDJava.util.StoredSetEJava.util.StoredMapFJava.util.Collection...
问题:多选题Which two demonstrate an “is a” relationship? ()Apublic interface Person{} public class Employee extends Person{}Bpublic interface Shape{} public class Employee extends Shape{}Cpublic interface Color{} public class Employee extends Color{}Dpublic cl...
问题:多选题AnInterface is an interface. AnAdapter0 is a non-abstract, non-final class with a zero argument constructor. AnAdapter1 is a non-abstract, non-final class without a zero argument constructor, but with a constructor that takes one int argument. W...
问题:单选题1. public class GC { 2. private Object o; 3. private void doSomethingElse(Object obj) { o = obj; } 4. public void doSomething() { 5. Object o = new Object(); 6. doSomethingElse(o); 7. o = new Object(); 8. doSomethingElse(null); 9.o=null; 10. }...
问题:单选题Which constructs a DataOutputStream?()A New dataOutputStream(“out.txt”);B New dataOutputStream(new file(“out.txt”));C New dataOutputStream(new writer(“out.txt”));D New dataOutputStream(new FileWriter(“out.txt”));E New dataOutputStream(new OutputSt...
问题:It is desirable that a certain method within a certain class...
问题:5. String foo = “base”; 6. foo.substring(0,3); 7. foo.co...
问题:单选题public class Test { private static int[] x; public static void main(String[] args) { System.out.println(x[0]); } } What is the result?()A 0B nullC Compilation fails.D A NullPointerException is thrown at runtime.E An ArrayIndexOutOfBoundsExc...