问题:单选题public class X { public static void main(String [] args) { try { badMethod(); System.out.print(“A”); } catch (Exception ex) { System.out.print(“C”); } finally { System.out.print(“B”); } System.out.print(“D”); } public static void badMetho...
查看答案
问题:单选题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”...
问题:单选题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 ...
问题:单选题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 implements Runnable( private int x; priv...
问题:Which of these are keywords in Java?() ...
问题:多选题1. public class Test { 2. public T findLarger(T x, T y) { 3. if(x.compareTo(y) 0) { 4. return x; 5. } else { 6. return y; 7. } 8. } 9. } and: 22. Test t = new Test(); 23. // insert code here Which two will compile without errors when inse...
问题: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...
问题:填空题3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()...
问题:单选题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...
问题:int i = 0, j = 5; tp; for (;;) { i++; for(;;) { if (i>...
问题:单选题11.classa { 12. public void process() { System.out.print(”a,”); } } 13. class b extends a { 14. public void process() throws IOException { 15. super.process(); 16. System.out.print(”b,”); 17. throw new IOException(); 18. } } 19. public static v...
问题:单选题for( int i = min; i A init i = min;while( i max ){}B int i = min; do system.out.println(i++); } while( i max );C for (int i=min; iD for (int i=; i++...
问题:33. Date d = new Date(0); 34. String ds = “December 15, 200...
问题:public class X implements Runnable ( private int x; priv...
问题:public class X { public object m () { object o = new flo...
问题:public class test ( public static void main (String args)...
问题:int i = 0; while (true) { if(i==4) { break; } ++i; } S...
问题:多选题Choose the three valid identifiers from those listed below.()AI Do Like The Long Name ClassB$byteCconstD_okE3_case...