반응형
자격증/OCJP_ExamC2018. 7. 25. 01:16QUESTION 39

QUESTION 39 Given: 11. public class Commander { 12. public static void main(String[] args) { 13. String myProp = /* insert code here */ 14. System.out.println(myProp); 15. } 16. } and the command line: java -Dprop.custom=gobstopper Commander Which two, placed on line 13, will produce the output gobstopper? (Choose two.) A. System.load("prop.custom"); B. System.getenv("prop.custom"); C. System.pr..

자격증/OCJP_ExamC2018. 7. 25. 01:12QUESTION 38

QUESTION 38 Given: interface Animal { void makeNoise(); } class Horse implements Animal { Long weight = 1200L; public void makeNoise() { System.out.println("whinny"); } } 01. public class Icelandic extends Horse { 02. public void makeNoise() { 03. System.out.println("vinny"); 04. } 05. 06. public static void main(String[] args) { 07. Icelandic i1 = new Icelandic(); 08. Icelandic i2 = new Iceland..

자격증/OCJP_ExamC2018. 7. 25. 00:57QUESTION 37

QUESTION 37 Given: 04. public class Tahiti { 05. Tahiti t; 06. 07. public static void main(String[] args) { 08. Tahiti t = new Tahiti(); 09. Tahiti t2 = t.go(t); 10. t2 = null; 11. // more code here 12. } 13. 14. Tahiti go(Tahiti t) { 15. Tahiti t1 = new Tahiti(); 16. Tahiti t2 = new Tahiti(); 17. t1.t = t2; 18. t2.t = t1; 19. t.t = t2; 20. return t1; 21. } 22. } When line 11 is reached, how man..

자격증/OCJP_ExamC2018. 7. 25. 00:51QUESTION 36

QUESTION 36 Which two code fragments are most likely to cause a StackOverflowError? (Choose two.) A. int []x = {1,2,3,4,5}; for(int y = 0; y

자격증/OCJP_ExamC2018. 7. 24. 20:43QUESTION 35

QUESTION 35 Which can appropriately be thrown by a programmer using Java SE technology to create a desktop application? A. ClassCastException B. NullPointerException C. NoClassDefFoundError D. NumberFormatException E. ArrayIndexOutOfBoundsException Solution : D plus imformation ClassCastException 발생 원인 :--> 자바 빈즈 컴포넌트객체의 사용시 ClassCastException이 발생하는 경우는 동일한 VM상에서 동일한 이름을 갖는 서로다른 컴포넌트가 두번 메모리에 로드..

자격증/OCJP_ExamC2018. 7. 24. 20:14QUESTION 34

QUESTION 34 Given: 11. public void testIfA() { 12. if (testIfB("True")) { 13. System.out.println("True"); 14. } else { 15. System.out.println("Not true"); 16. } 17. } 18. public Boolean testIfB(String str) { 19. return Boolean.valueOf(str); 20. } What is the result when method testIfA is invoked? A. True B. Not true C. An exception is thrown at runtime. D. Compilation fails because of an error a..

반응형
image