Which two are equivalent? ()
A16>4
B16/2
C16*4
D16>>2
E16/2^2
F16>>>2
相关问题推荐
-
What is the result as follows?()
A、 5,6
B、 5,5
C、 6,5
D、 6,6
-
If this source code is contained in a file called SmallProg.java, what command should be used to compile it using the JDK?() public class SmallProg { public static void main(String args[]) { System.out.println("Good luck!"); } }
A、java SmallProg
B、avac SmallProg
C、javac SmallProg.java
D、java SmallProg main
-
class A { public byte getNumber () { return 1; } } class B extends A { public short getNumber() { return 2; } public static void main (String args) { B b = new B (); System.out.printIn(b.getNumber()) } } What is the result?()
A、 Compilation succeeds and 1 is printed.
B、 Compilation succeeds and 2 is printed.
C、 An error at line 8 causes compilation to fail.
D、 An error at line 14 causes compilation to fail.
E、 Compilation succeeds but an exception is thrown at line 14.
-
11. public enum Title { 12. MR(”Mr.”), MRS(”Mrs.”), MS(”Ms.”); 13. private final String title; 14. private Title(String t) { title = t; } 15. public String format(String last, String first) { 16. return title + “ “ + first + “ “ + last; 17. } 18. } 19. public static void main(String[] args) { 20. System.out.println(Title.MR.format(”Doe”, “John”)); 21. } What is the result?()
A、 Mr. John Doe
B、 An exception is thrown at runtime.
C、 Compilation fails because of an error in line 12.
D、 Compilation fails because of an error in line 15.
E、 Compilation fails because of an error in line 20.
-
1. public class X implements Runnable( 2. private int x; 3. private int y; 4. 5. public static void main(String[]args) 6. X that = new X(); 7. (new Thread(that)).start(); 8. (new Thread(that)).start(); 9. ) 10. 11. public void run() ( 12. for (;;) ( 13. x++; 14. y++; 15. System.out.printIn(“x=” + x + “, y = ” + y); 16. ) 17. ) What is the result?()
A、 Errors at lines 7 and 8 cause compilation to fail.
B、 The program prints pairs of values for x and y that might not always be the same on the same line (for example, “x=2, y=1”).
C、 The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by “x=1, y=1”).
D、 The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears only for once (for example, “x=1, y=1” followed by “x=2, y=2”).