当前分类: SCJP程序员认证考试
问题:boolean bool = true; if(bool = false) { System.out.println(“...
查看答案
问题:单选题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...
问题:The 8859-1 character code for the uppercase letter A is 65. ...
问题:多选题1. class BaseClass { 2. private float x = 1.of; 3. protected float getVar() { return x; } 4. } 5. class SubClass extends BaseClass { 6. private float x = 2.Of; 7. // insert code here 8. } Which two are valid examples of method overriding when i...
问题:1) class Person { 2) public void printValue(int i, int j) {...
问题:单选题1. public class Test { 2. public static void main (String []args) { 3. unsigned byte b = 0; 4. b--; 5. 6. } 7. } What is the value of b at line 5?()A -1B 255C 127D Compilation will fail.E Compilation will succeed but the program will...
问题:多选题package com.company.application; public class MainClass { public static void main(String[] args) { } } And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH environment variable is set to “.“ (current directory)....
问题:多选题public class X { public X aMethod() { return this;} } public class Y extends X { } Which two methods can be added to the definition of class Y?()Apublic void aMethod() {}Bprivate void aMethod() {}Cpublic void aMethod(String s) {}Dprivate Y aMethod...
问题:多选题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?() ...
问题:Which method is an appropriate way to determine the cosine o...
问题:System.out.println(Math.sqrt(-4D)); What is the result?() ...
问题:多选题public class Key { private long id1; private long 1d2; // class Key methods } A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap. Which two methods should be overridden to assure that Key works corre...
问题:Which statement is true for the class java.util.ArrayList?()...
问题:单选题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...
问题:单选题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...
问题:11. public enum Title { 12. MR(”Mr.”), MRS(”Mrs.”), MS(”Ms....
问题:多选题Which two statements are reserved words in Java?()ARunBImportCDefaultDImplement...
问题:单选题String a = null; a.concat(“abc”); a.concat(“def”); System.out.println(a); What is the result?()A abcB nullC abcdefD Compilation fails.E The code runs with no output.F An exception is thrown at runtime....
问题:单选题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...