9 - PDFsam - 8. OOPs
9 - PDFsam - 8. OOPs
Q: 14 Given:
Answer: A
Q: 15 Given:
12. public class Wow {
13. public static void go(short n) {System.out.println("short");}
14. public static void go(Short n) {System.out.println("SHORT");}
15. public static void go(Long n) {System.out.println(" LONG");}
16. public static void main(String [] args) {
17. Short y = 6;
18. int z = 7;
19. go(y);
20. go(z);
21. }
22. }
What is the result?
A. short LONG
B. SHORT LONG
C. Compilation fails.
D. An exception is thrown at runtime.
Answer: C
Which three code fragments, added individually at line 29, produce the output 100? (Choose
three.)