반응형
자격증/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..

자격증/OCJP_ExamC2018. 7. 24. 20:08QUESTION 33

QUESTION 33 Given: 1. public static void main(String[] args) { 2. for (int i = 0; i 6) break; 4. } 5. System.out.println(i); 6. } What is the result? A. 6 B. 7 C. 10 D. 11 E. Compilation fails. F. An exception is thrown at runtime. Solution : E plus imformation Main.java:5: cannot find symbol symbol : variable i location: class Breaker System.out.println(i); ^ 1 error

자격증/OCJP_ExamC2018. 7. 24. 20:03QUESTION 32

QUESTION 32 Given: 1. public static void main(String[] args) { 2. try { 3. args = null; 4. args[0] = "test"; 5. System.out.println(args[0]); 6. } catch (Exception ex) { 7. System.out.println("Exception"); 8. } catch (NullPointerException npe) { 9. System.out.println("NullPointerException"); 10. } 11. } What is the result? A. test B. Exception C. Compilation fails. D. NullPointerException Solutio..

자격증/OCJP_ExamC2018. 7. 24. 03:34QUESTION 31

QUESTION 31 Given: 11. public void go(int x) { 12. assert (x > 0); 13. switch(x) { 14. case 2: ; 15. default: assert false; 16. } 17. } 18. private void go2(int x) { assert (x

반응형
image