-
2017.08.05
[1Z0-851A] Question 31~40
QUESTION 31 Given: public class Score implements Comparable { private int wins, losses; public Score(int w, int l) { wins = w; losses = l; } public int getWins() { return wins; } public int getLosses() { return losses; } public String toString() { return ""; } // insert code here } Which method will complete this class? A. public int compareTo(Object o){/*more code here*/} B. public int compareT..
-
2017.08.05
[1Z0-851A] Question 21~30
QUESTION 21 Given: 5. class Building { } 6. public class Barn extends Building { 7. public static void main(String[] args) { 8. Building build1 = new Building(); 9. Barn barn1 = new Barn(); 10. Barn barn2 = (Barn) build1; 11. Object obj1 = (Object) build1; 12. String str1 = (String) build1; 13. Building build2 = (Building) barn1; 14. } 15. } Which is true? A. If line 10 is removed, the compilati..
-
2017.08.05
[1Z0-851A] Question 11~20
QUESTION 11 Given: 1. public class Rainbow { 2. public enum MyColor { 03. RED(0xff0000), GREEN(0x00ff00), BLUE(0x0000ff); 4. private final int rgb; 5. MyColor(int rgb) { this.rgb = rgb; } 6. public int getRGB() { return rgb; } 07. }; 8. public static void main(String[] args) { 9. //insert code here 10. } 11. } Which code fragment, inserted at line 9, allows the Rainbow class to compile? A. MyCol..
-
2017.08.04
[1Z0-851A] Question 01~10
QUESTION 1 Given: public class Threads2 implements Runnable { public void run() { System.out.println("run."); throw new RuntimeException("Problem"); } public static void main(String[] args) { Thread t = new Thread(new Threads2()); t.start(); System.out.println("End of method."); } } Which two can be results? (Choose two.) A. java.lang.RuntimeException: Problem B. run. java.lang.RuntimeException:..
-
2017.07.12
OCJP Dumps
OCJP Dumps (PDF Format)