当前分类: SCJP程序员认证考试
问题:11. public enum Title { 12. MR(”Mr.”), MRS(”Mrs.”), MS(”Ms....
查看答案
问题:Which of the following statements are legal?() ...
问题:单选题11.classA { 12. public void process() { System.out.print(”A “); } } 13. class B extends A { 14. public void process() throws RuntimeException { 15. super.process(); 16. if (true) throw new RuntimeException(); 17. System.out.print(“B”); }} 18. pu...
问题:Given the following code, which statements concerning the ob...
问题:Which method is an appropriate way to determine the cosine o...
问题:单选题public class Foo { public void main( String[] args ) { System.out.println( “Hello” + args[0] ); } } What is the result if this code is executed with the command line?()A HelloB Hello FooC Hello worldD Compilation fails.E The code does not ru...
问题:多选题class A { } class Alpha { private A myA = new A(); void dolt( A a ) { a = null; } void tryIt() { dolt( myA ); } } Which two statements are correct?()AThere are no instanced of A that will become eligible for garbage collection.BExplicitly se...
问题:Which statement is true for the class java.util.ArrayList?()...
问题:单选题static void test() throws Error { if (true) throw new AssertionError(); System.out.print(”test “); } public static void main(String[] args) { try { test(); } catch (Exception ex) { System.out.print(”exception “); } System.out.print(”elld “); } ...
问题:单选题How can you create a listener class that receives events when the mouse is moved?()A By extending MouseListener.B By implementing MouseListener.C By extending MouseMotionListener.D By implementing MouseMotionListener.E Either by extending MouseMot...
问题:多选题Which three form part of correct array declarations?()Apublic int a []Bstatic int [] aCpublic [] int aDprivate int a [3]Eprivate int [3] a []Fpublic final int [] a...
问题:Use the operators "<<", ">>", which statements are true? () ...
问题:多选题Which two statements are reserved words in Java?()ARunBImportCDefaultDImplement...
问题:单选题Which method implementations will write the given string to a file named "file", using UTF8 encoding?() IMPLEMENTATION a: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.write(msg); fw.c...
问题:多选题Given that b and c refer to instances of wrapper classes, which two statements are true?()Ab.equals(b) returns true.Bb.equals(c) returns the same result as b == c.Cb.eqials(c) can return false even if c.equals(b) returns true.Db.equals(c) throws an exc...
问题:A programmer needs to create a logging method that can accep...
问题:单选题What will be written to the standard output when the following program is run?() public class Q63e3 { public static void main(String args[]) { System.out.println(9 ^ 2); } }A 81B 7C 11D 0E false...
问题:单选题public class X { public static void main (Stringargs) { string s = new string (“Hello”); modify(s); System.out.printIn(s); } public static void modify (String s) { s += “world!”; } } What is the result?()A The program runs and print...
问题:多选题Which two are true?()AAn encapsulated, public class promotes re-use.BClasses that share the same interface are always tightly encapsulated.CAn encapsulated class allows subclasses to overload methods, but does NOT allow overriding methods.DAn encapsula...
问题:单选题What happens when thread X executes a wait() method on object A, without owning object A’s lock?()A Compilation fails.B An exception is thrown.C The wait() method has no effect.D Thread X receives the lock immediately.E Object A moves the thread t...