반응형
자격증/OCJP_ExamB2018. 7. 9. 16:15QUESTION 10

QUESTION 10 Given: import java.util.*; public class Mapit { public static void main(String[] args) { Set set = new HashSet(); Integer i1 = 45; Integer i2 = 46; set.add(i1); set.add(i1); set.add(i2); System.out.print(set.size() + " "); set.remove(i1); System.out.print(set.size() + " "); i2 = 47; set.remove(i2); System.out.print(set.size() + " "); } } What is the result? A. 2 1 0 B. 2 1 1 C. 3 2 1..

자격증/OCJP_ExamB2018. 7. 9. 15:55QUESTION 9

QUESTION 9 Given: enum Example { ONE, TWO, THREE } Which statement is true? A. The expressions (ONE == ONE) and ONE.equals(ONE) are both guaranteed to be true. B. The expression (ONE < TWO) is guaranteed to be true and ONE.compareTo(TWO) is guaranteed to be less than one. C. The Example values cannot be used in a raw java.util.HashMap; instead, the programmer must use a java.util.EnumMap. D. The..

자격증/OCJP_ExamB2018. 7. 9. 15:38QUESTION 8

QUESTION 8 Given that the elements of a PriorityQueue are ordered according to natural ordering, and: import java.util.*; public class GetInLine { public static void main(String[] args) { PriorityQueue pq = new PriorityQueue(); pq.add("banana"); pq.add("pear"); pq.add("apple"); System.out.println(pq.poll() + " " + pq.peek()); } } What is the result? A. apple pear B. banana pear C. apple apple D...

자격증/OCJP_ExamB2018. 7. 9. 15:29QUESTION 7

QUESTION 7 Given: 3. import java.util.*; 4. public class G1 { 5. public void takeList(List

자격증/OCJP_ExamB2018. 7. 9. 15:05QUESTION 6

QUESTION 6 Given: 1. import java.util.*; 2. public class WrappedString { 3. private String s; 4. public WrappedString(String s) { this.s = s; } 5. public static void main(String[] args) { 6. HashSet hs = new HashSet();7. WrappedString ws1 = new WrappedString("aardvark"); 8. WrappedString ws2 = new WrappedString("aardvark"); 9. String s1 = new String("aardvark"); 10. String s2 = new String("aardv..

자격증/OCJP_ExamB2018. 7. 9. 00:37QUESTION 5

QUESTION 5 Given: 10. interface Jumper { public void jump(); } ... 20. class Animal {} ... 30. class Dog extends Animal { 31. Tail tail; 32. } ... 40. class Beagle extends Dog implements Jumper{ 41. public void jump() {} 42. } ... 50. class Cat implements Jumper{ 51. public void jump() {} 52. } Which three are true? (Choose three.) A. Cat is-a Animal B. Cat is-a Jumper C. Dog is-a Animal D. Dog ..

반응형
image