当前分类: SCJP程序员认证考试
问题:单选题Which gets the name of the parent directory file “file.txt”?()A String name= File.getParentName(“file.txt”);B String name= (new File(“file.txt”)).getParent();C String name = (new File(“file.txt”)).getParentName();D String name= (new File(“file.txt”...
查看答案
问题:Which will declare a method that is available to all members...
问题:单选题1. public class ForBar { 2. public static void main(String []args) { 3. int i = 0, j = 5; 4. tp: for (;;) { 5. i ++; 6. for(;;) 7. if(i --j) break tp; 8. } 9. system.out.printIn(“i = ” + i + “, j = “+ j); 10. } 11. } What is the resu...
问题:单选题Which interface does java.util.Hashable implement?()A Java.util.Map.B Java.util.List.C Java.util.Hashable.D Java.util.Collection....
问题:public class X implements Runnable( private int x; priv...
问题:单选题public class foo { public static void main (string[]args) try {return;} finally {system.out.printIn(“Finally”);} } What is the result?()A The program runs and prints nothing.B The program runs and prints “Finally”C The code compiles, but an exc...
问题:单选题A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user wants to execute the main method of Poker on a UNIX system using the command: java games.cards.Poker What allows the user to do this?()A put Poker.jar in directory /stuff/...
问题:填空题3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()...
问题:public class X { public object m () { object o = new flo...
问题:int i = 0; while (true) { if(i==4) { break; } ++i; } S...
问题:public class Threads3 implements Runnable { public void run...
问题:单选题class super { public int getLength() {return 4;} } public class Sub extends Super { public long getLength() {return 5;} public static void main (Stringargs) { super sooper = new Super (); Sub sub = new Sub(); System.out.printIn( soope...
问题:11. public static void append(List list) { list.add(”0042”);...
问题:public class foo { public static void main (String[]args) {...
问题:Which of these are keywords in Java?() ...
问题:多选题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...
问题:多选题11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivateFabstractGprotected...
问题:public class X { public static void main(String [] args) { ...
问题:单选题Which statements, when inserted at the indicated position in the following code, will cause a runtime exception when attempting to run the program?() class A {} class B extends A {} class C extends A {} public class Q3ae4 { public static void...