Given: Which two are true?()
A.The output is mm. B.The output is mc. C.Component is-a Meter. D.Component has-a Meter. E.DeluxeThingy is-a Component. F.DeluxeThingy has-a Component.
多项选择题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?()
A.p0 = p1; B.p1 = p2; C.p2 = p4; D.p2 = (ClassC)p1; E.p1 = (ClassB)p3; F.p2 = (ClassC)p4;
单项选择题Given: Which statement is true?()
A.420 is the output. B.An exception is thrown at runtime. C.All constructors must be declared public. D.Constructors CANNOT use the private modifier. E.Constructors CANNOT use the protected modifier.
单项选择题A company that makes Computer Assisted Design (CAD) software has, within its application, some utilityclasses that are used to perform 3D rendering tasks. The company’s chief scientist has just improved theperformance of one of the utility classes’ key rendering algorithms, and has assigned a programmer toreplace the old algorithm with the new algorithm. When the programmer begins researching the utilityclasses, she is happy to discover that the algorithm to be replaced exists in only one class. The programmer reviews that class’s API, and replaces the old algorithm with the new algorithm, being carefulthat her changes adhere strictly to the class’s API. Once testing has begun, the programmer discovers thatother classes that use the class she changed are no longer working properly. What design flaw is mostlikely the cause of these new bugs?()
A.Inheritance B.Tight coupling C.Low cohesion D.High cohesion E.Loose coupling
单项选择题Given: What is the result?()
A.b 3 B.b 8 C.b 13 D.f 3
A.12 B.The code runs with no output. C.An exception is thrown at runtime. D.Compilation fails because of an error in line 21. E.Compilation fails because of an error in line 22. F.Compilation fails because of an error in line 31.