当前分类: SCJP程序员认证考试
问题:Which statement is true for the class java.util.ArrayList?()...
查看答案
问题:单选题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...
问题:单选题String foo = “blue”; Booleanbar = new Boolean [1]; if (bar[0]) { foo = “green”; } What is the result?()A Foo has the value of “”B Foo has the value of null.C Foo has the value of “blue”D Foo has the value of “green”E An exception is ...
问题:单选题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...
问题:单选题int i = 0; for (; i 4; i += 2) { System.out.print(i + “”); } System.out.println(i); What is the result?()A 0 2 4B 0 2 4 5C 0 1 2 3 4D Compilation fails.E An exception is thrown at runtime....
问题:单选题public class Foo { public static void main (String []args) { int i = 1; int j = i++; if ((i++j) (i++ ==j)) { i +=j; } } } What is the final value of i?()A 1B 2C 3D 4E 5...
问题:单选题class Base { Base() { System.out.print(“Base”); } } public class Alpha extends Base { public static void main( String[] args ) { new Alpha(); new Base(); } } What is the result?()A BaseB BaseBaseC Compilation fails.D The code runs with no ...
问题:单选题public class Mycircle { public double radius; public double diameter; public void setRadius(double radius) this.radius = radius; this.diameter= radius * 2; } public double getRadius() { return radius; } Which statement is true?()A T...
问题:11. public enum Title { 12. MR(”Mr.”), MRS(”Mrs.”), MS(”Ms....
问题:多选题Which two statements are reserved words in Java?()ARunBImportCDefaultDImplement...
问题:单选题Which Man class properly represents the relationship “Man has a best friend who is a Dog”?()A class Man extends Dog { }B class Man implements Dog { }C class Man { private BestFriend dog; }D class Man { private Dog bestFriend; }E class Man { privat...
问题:单选题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 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...
问题:When comparing java.io.BufferedWriter to java.io.FileWriter,...
问题:Which two demonstrate encapsulation of data? ()...
问题:Which method is an appropriate way to determine the cosine o...
问题:单选题public class Person { private name; public Person(String name) { this.name = name; } public boolean equals(Object o) { if( !o instanceof Person ) return false; Person p = (Person) o; return p.name.equals(this.name); } } Which is true?()A Co...
问题:public class Test { public static void add3 (Integer i) { ...
问题:多选题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 of the following statements are legal?() ...