반응형
자격증/OCJP_ExamB2018. 7. 11. 14:01QUESTION 39

QUESTION 39 Given classes defined in two different files: 1. package util; 2. public class BitUtils { 3. private static void process(byte[] b) {} 4. } and 1. package app; 2. public class SomeApp { 3. public static void main(String[] args) { 4. byte[] bytes = new byte[256]; 5. // insert code here 6. } 7. } What is required at line 5 in class SomeApp to use the process method of BitUtils? A. proce..

자격증/OCJP_ExamB2018. 7. 11. 00:09QUESTION 38

QUESTION 38 Given: 01. public static void test(String str) { 02. int check = 4; 03. if (check = str.length()) { 04. System.out.print(str.charAt(check -= 1) +", "); 05. } else { 06. System.out.print(str.charAt(0) + ", "); 07. } 08. } and the invocation: test("four"); test("tee"); test("to"); What is the result? A. r, t, t, B. r, e, o, C. Compilation fails. D. An exception is thrown at runtime. So..

자격증/OCJP_ExamB2018. 7. 10. 23:01QUESTION 36

QUESTION 36 Given: class Snoochy { Boochy booch; public Snoochy() { booch = new Boochy(this); } } class Boochy { Snoochy snooch; public Boochy(Snoochy s) { snooch = s; } } And the statements: 21. public static void main(String[] args) { 22. Snoochy snoog = new Snoochy(); 23. snoog = null; 24. // more code here 25. } Which statement is true about the objects referenced by snoog, snooch, and booch..

자격증/OCJP_ExamB2018. 7. 10. 22:49QUESTION 35

QUESTION 35 Which three code fragments, added individually at line 29, produce the output 100? (Choose three.) 10. class Inner { 11. private int x; 12. public void setX( int x ){ this.x = x; } 13. public int getX(){ return x;} 14. } 15. 16. class Outer { 17. private Inner y; 18. public void setY( Inner y ){ this.y = y; } 19. public Inner getY() { return y; } 20. } 21. 22. public class Gamma { 23..

자격증/OCJP_ExamB2018. 7. 10. 22:42QUESTION 34

QUESTION 34 Given classes defined in two different files: 1. package util; 2. public class BitUtils { 3. public static void process(byte[] b) { /* more code here */ } 4. } 1. package app; 2. public class SomeApp { 3. public static void main(String[] args) { 4. byte[] bytes = new byte[256]; 5. // insert code here 6. } 7. } What is required at line 5 in class SomeApp to use the process method of B..

자격증/OCJP_ExamB2018. 7. 10. 17:50QUESTION 32

QUESTION 32 Given 11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12? (Choose three.) A. final B. static C. native D. public E. private F. abstract G. protected Solution : ABD plus imformation C : 자바에서 지원하는 다른 언어와의 연동이 가능하게 해주는 메소드F : 추상화 클래스를 만들 때 사용

반응형
image