반응형
자격증/OCJP_ExamB2018. 7. 9. 00:27QUESTION 4

QUESTION 4 Given: class Thingy { Meter m = new Meter(); } class Component { void go() { System.out.print("c"); } } class Meter extends Component { void go() { System.out.print("m"); } } 8. class DeluxeThingy extends Thingy { public static void main(String[] args) { DeluxeThingy dt = new DeluxeThingy(); dt.m.go(); Thingy t = new DeluxeThingy(); t.m.go();} } Which two are true? (Choose two.) A. Th..

자격증/OCJP_ExamB2018. 7. 9. 00:13QUESTION 3

QUESTION 3 Given: class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB();ClassC p2 = new ClassC(); ClassA p3 = new ClassB(); ClassA p4 = new ClassC(); Which three are valid? (Choose three.) A. p0 = p1; B. p1 = p2; C. p2 = p4; D. p2 = (ClassC)p1; E. p1 = (ClassB)p3; F. p2 = (ClassC)p4; Solution : AEF plus imformation :..

자격증/OCJP_ExamB2018. 7. 8. 23:30QUESTION 2

QUESTION 2 Given: 1. class ClassA { 2. public int numberOfInstances; 3. protected ClassA(int numberOfInstances) { 4. this.numberOfInstances = numberOfInstances; 5. } 6. } 7. public class ExtendedA extends ClassA { 8. private ExtendedA(int numberOfInstances) { 9. super(numberOfInstances); 10. } 11. public static void main(String[] args) { 12. ExtendedA ext = new ExtendedA(420); 13. System.out.pri..

자격증/OCJP_ExamB2018. 7. 8. 23:11QUESTION 1

QUESTION 1 A company that makes Computer Assisted Design (CAD) software has, within its application, some utility classes that are used to perform 3D rendering tasks. The company's chief scientist has just improved the performance of one of the utility classes' key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins ..

반응형
image