반응형
자격증/OCJP_ExamB2018. 7. 10. 17:19QUESTION 28

QUESTION 28 Given: 10. interface Foo { int bar(); } 11. public class Sprite { 12. public int fubar( Foo foo ) { return foo.bar(); } 13. public void testFoo() { 14. fubar( 15. //insert code here 16. ); 17. } 18. } Which code, inserted at line 15, allows the class Sprite to compile? A. Foo { public int bar() { return 1; } B. new Foo { public int bar() { return 1; } C. new Foo() { public int bar() ..

QUESTION 27
자격증/OCJP_ExamB2018. 7. 10. 17:03QUESTION 27

QUESTION 27 Click the Exhibit button. Given the fully-qualified class names: com.foo.bar.Dog com.foo.bar.blatz.Book com.bar.Carcom.bar.blatz.Sun Which graph represents the correct directory structure for a JAR file from which those classes can be used by the compiler and JVM? A. Jar A B. Jar B C. Jar C D. Jar D E. Jar E Solution : A plus imformation com.foo.bar.Dog // com : 공통된 상위 파일 폴더 이름 --> f..

자격증/OCJP_ExamB2018. 7. 10. 16:54QUESTION 26

QUESTION 26 Given: 1. public class ClassA { 2. public void methodA() { 3. ClassB classB = new ClassB(); 4. classB.getValue(); 5. } 6. } 7. 8. class ClassB { 9. public ClassC classC; 10. public String getValue() { 11. return classC.getValue(); 12. } 13. } 14. 15. class ClassC { 16. public String value; 17. public String getValue() { 18. value = "ClassC"; 19. return value; 20. } 21. } and: ClassA ..

자격증/OCJP_ExamB2018. 7. 10. 16:46QUESTION 25

QUESTION 25 Given: 35. String #name = "Jane Doe"; 36. int $age = 24; 37. Double _height = 123.5; 38. double ~temp = 37.5; Which two statements are true? (Choose two.) A. Line 35 will not compile. B. Line 36 will not compile. C. Line 37 will not compile. D. Line 38 will not compile. Solution : AD plus imformation A variable's name can be any legal identifier — an unlimited-length sequence of Unic..

자격증/OCJP_ExamB2018. 7. 10. 16:14QUESTION 24

QUESTION 24 Given: 1. public class A { 2. public void doit() { 3. } 4. public String doit() { 5. return "a"; 6. } 7. public double doit(int x) { 8. return 1.0; 9. } 10. } What is the result? A. An exception is thrown at runtime. B. Compilation fails because of an error in line 7. C. Compilation fails because of an error in line 4. D. Compilation succeeds and no runtime errors with class A occur...

자격증/OCJP_ExamB2018. 7. 10. 15:52QUESTION 23

QUESTION 23 Given: package com.sun.scjp;public class Geodetics { public static final double DIAMETER = 12756.32; // kilometers } Which two correctly access the DIAMETER member of the Geodetics class? (Choose two.) A. import com.sun.scjp.Geodetics; public class TerraCarta { public double halfway() { return Geodetics.DIAMETER/2.0; } B. import static com.sun.scjp.Geodetics; public class TerraCarta{..

반응형
image