当前分类: SCJP程序员认证考试
问题:The file “file.txt” exists on the file system and contsins A...
查看答案
问题:多选题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...
问题:public class SwitchTest { public static void main (String ...
问题:switch (i) { default: System.out.printIn(“Hello”); } Wh...
问题:单选题public class Test { private static float[] f = new float[2]; public static void main(String args[]) { System.out.println(“f[0] = “ + f[0]); } } What is the result?()A f[0] = 0B f[0] = 0.0C Compilation fails.D An exception is thrown at runtim...
问题:Which method is an appropriate way to determine the cosine o...
问题:单选题1. public class returnIt ( 2. returnType methodA(byte x, double y) ( 3. return (short) x/y * 2; 4. ) 5. ) What is the valid returnType for methodA in line 2?()A IntB ByteC LongD ShortE FloatF Double...
问题:多选题Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()AThe class implements java.lang.Comparable.BThe class implements java.util.Comparator.CThe interface used ...
问题:单选题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...
问题:单选题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 OuterClass { private double d1 1.0; //insert...
问题:Which statement is true for the class java.util.ArrayList?()...
问题:1. class A implements runable ( 2. int i; 3. public void...
问题:单选题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...
问题:Which Man class properly represents the relationship “Man ha...
问题:多选题Which two statements are reserved words in Java?()ARunBImportCDefaultDImplement...
问题:11. public enum Title { 12. MR(”Mr.”), MRS(”Mrs.”), MS(”Ms....
问题:单选题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 of the following statements are legal?() ...
问题:try { if ((new Object))(.equals((new Object()))) { System....