当前分类: SCJP程序员认证考试
问题:Which of these are keywords in Java?() ...
查看答案
问题:多选题Which of the following fragments might cause errors?()AString s = Gone with the wind;String t = good ;String k = s + t;BString s = Gone with the wind;String t;t = s[3] + one;CString s = Gone with the wind;String standard = s.toUpperCase();DString s = ...
问题:class One { void foo() {} } class Two extends One { //i...
问题:填空题1. public class Test { 2. public static String output =””; 3. 4. public static void foo(int i) { 5. try { 6. if(i==1) { 7. throw new Exception(); 8. } 9. output += “1”; 10. } 11. catch(Exception e) { 12. output += “2”; 13. return; 14. } 15. finally { ...
问题:单选题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...
问题:public class X { public object m () { object o = new flo...
问题:单选题public class X { public static void main (String[]args) { String s1 = new String (“true”); Boolean b1 = new Boolean (true); if (s2.equals(b1)) { System.out.printIn(“Equal”); } } } What is the result?()A The program runs and prints noth...
问题:How does the weighty property of the GridBagConstraints obje...
问题:单选题What will be written to the standard output when the following program is run?() public class Qd803 { public static void main(String args[]) { String word = "restructure"; System.out.println(word.substring(2, 3)); } }A estB esC strD stE s...
问题:单选题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...
问题:单选题What will be written to the standard output when the following program is run?() public class Q03e4 { public static void main(String args[]) { String space = " "; String composite = space + "hello" + space + space; composite.concat("world"); ...
问题:填空题3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()...
问题:public class X implements Runnable( private int x; priv...
问题:单选题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 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...
问题:public class X { public static void main(String [] args) { ...
问题:多选题11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivateFabstractGprotected...
问题:int i = 0; while (true) { if(i==4) { break; } ++i; } S...
问题:单选题public class Test { public static void main(String[] args) { int x = 0; assert (x 0) ? “assertion failed” : “assertion passed”; System.out.println(“Finished”); } } What is the result?()A finishedB Compilation fails.C An AssertionError is thr...
问题:单选题Which is a valid identifier?()A falseB defaultC _objectD a-class...