별의 공부 블로그 🧑🏻‍💻

🗒️ 2017/08/12 (6)

728x90
  1. 2017.08.12 [1Z0-851C] Question 51~60

    QUESTION 51 Given classes defined in two different files: package packageA; public class Message { String getText() { return "text"; } } And: package packageB; public class XMLMessage extends packageA.Message { String getText() { return "text"; } public static void main(String[] args) { System.out.println(new XMLMessage().getText()); } } What is the result of executing XMLMessage.main? A. text B..

  2. 2017.08.12 [1Z0-851C] Question 41~50

    QUESTION 41 Given: public static void main(String[] args) { for (int i = 0; i 6) break; } System.out.println(i); } What is the result? A. 6 B. 7 C. 10 D. 11 E. Compilation fails. F. An exception is thrown at runtime. Correct Answer: E Section: All Explanation Explanation/Reference: i varaible is not visible. QUESTION 42 Given: 11. class X { public void foo() { System.out.print("X "); } } 12. 13...

  3. 2017.08.12 [1Z0-851C] Question 31~40

    QUESTION 31 Given: public class Person { private name; public Person(String name) { this.name = name; } public int hashCode() { return 420; } } Which statement is true? A. The time to find the value from HashMap with a Person key depends on the size of the map. B. Deleting a Person key from a HashMap will delete all map entries for all keys of type Person. C. Inserting a second Person object int..

  4. 2017.08.12 [1Z0-851C] Question 21~30

    QUESTION 21 Given: class Line { public class Point { public int x, y; } public Point getPoint() { return new Point(); } } class Triangle { public Triangle() { // insert code here } } Which code, inserted at line 16, correctly retrieves a local instance of a Point object? A. Point p = Line.getPoint(); B. Line.Point p = Line.getPoint(); C. Point p = (new Line()).getPoint(); D. Line.Point p = (new ..

  5. 2017.08.12 [1Z0-851C] Question 11~20

    QUESTION 11 Given: 1. public class Hi { 2. void m1() { } 3. protected void() m2 { } 04. } 05. 6. class Lois extends Hi { 7. // insert code here 08. } Which four code fragments, inserted independently at line 7, will compile? (Choose four.) A. public void m1() { } B. protected void m1() { } C. private void m1() { } D. void m2() { } E. public void m2() { } F. protected void m2() { } G. private voi..

  6. 2017.08.12 [1Z0-851C] Question 01~10

    QUESTION 1 Given: import java.util.Date; import java.text.DateFormat; 21. DateFormat df; 22. Date date = new Date(); 23. //insert code here 24. String s = df.format(date); Which code fragment, inserted at line 23, allows the code to compile? A. df = new DateFormat(); B. df = Date.getFormat(); C. df = date.getFormat(); D. df = DateFormat.getFormat(); E. df = DateFormat.getInstance(); Correct Answ..

728x90


📖 Contents 📖