当前分类: 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”...
查看答案
问题:单选题public class TwoThreads { private static Object resource = new Object(); private static void delay(long n) { try { Thread.sleep(n); } catch (Exception e) { System.out.print(”Error “); } } public static void main(String[] args) { System.out.print...
问题:多选题11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivateFabstractGprotected...
问题:Which of these are keywords in Java?() ...
问题:int i = 0; while (true) { if(i==4) { break; } ++i; } S...
问题:填空题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 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...
问题:Given the following code, write a line of code that, when in...
问题:填空题Public class test ( Public static void stringReplace (String text) ( Text = text.replace („j„ , „i„); ) public static void bufferReplace (StringBuffer text) ( text = text.append (“C”) ) public static void main (String args ){ 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 allows the programmer to destroy an object x?() ...
问题:多选题Which two are equivalent?()A3/2B32C3*4D32E3*2^2F32...
问题:What produces a compiler error?() ...
问题:单选题Which statement is true?()A If only one thread is blocked in the wait method of an object, and another thread executes the modify on that same object, then the first thread immediately resumes execution.B If a thread is blocked in the wait method of ...
问题:public class X { public object m () { object o = new flo...
问题:单选题void waitForSignal() { Object obj = new Object(); synchronized (Thread.currentThread()) { obj.wait(); obj.notify(); } } Which is true?()A This code may throw an InterruptedException.B This code may throw an IllegalStateException.C This code m...
问题:单选题The file “file.txt” exists on the file system and contsins ASCII text. Given: try { File f = new File(“file.txt”); OutputStream out = new FileOutputStream(f, true); } catch (IOException) {} What is the result?()A The code does not compi...
问题:public class X implements Runnable( private int x; priv...