Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

b) False 13) Being able to declare a List is made possible by a) Generic types b

ID: 2247099 • Letter: B

Question

b) False 13) Being able to declare a List is made possible by a) Generic types b) Inheritance c STL d) Plug-ins e) Embedding 14) When an object is instantiated a) A class destructor is called b) Memory is allocated c) Class methods (i.e, static methods) can then be used d) It can be extended e) None of the above 15) Which of the following is true? a) Classes can subclass only one parent class, but can implement many in b) Classes can subclass many parent classes, but can implement only one c) Classes can subclass many parent classes and implement many interf d) All of the above e) None of the above 16) One method M1 in class C1 overloads another method M2 when: a) M2 is defined in a subclass of C1 and M2 and has the same name, re parameter types as M1 b) Both are in the same class and M1 and has the same name, return c) d) e) parameter types as M2 Both are in the same class and M1 and has the same name and re but different parameter types/order M2 is defined in a superclass of C1 and M2 and has the same na as M2, but different parameter types/order None of the above 17) A public class method is one that a) Is available only to instances (objects) of that class b) Is available only to instances (objects) of classes in the sam c) Can only be called in the class constructor d) Can be called without instantiating the class e) None of these

Explanation / Answer

Note: Not all questions have been answered, as there are too many questions, in one query

9)Since Car "has a" engine, muffler. It can be either Composition or Aggregation. But since, when car gets destroyed, so is the engine and muffler as well. Hence it will be Composition

10)Since, Zoo "has a" Zebra, or Giraffe. It can be either Composition or Aggregation. But since, if Zoo gets destroyed. You won't likely be destroying animals(or they will run away), hence it will be Aggregation.(A is the answer)

11)Sets do not have order, nor they contains any duplicates(A is the answer)

13)Generic Types: The <> enables the class to adapt to different classes, without changing implementation.(A is the answer)

14)Memory is allocated: Class is only a road map, object is its implementation. Hence when an object is created. Memory is allocated to hold it.(B is the answer)

15)In java, there is no multiple inheritance, hence only one class be an immediate parent. However there can be as many interfaces as required which can be implemented by one class. (A is the answer)

16)D is the answer. It the method signature is same, then that will be termed as method overriding. For method overloading, the name should be the same but parameters different. Also, since M2 is now in superclass, which means it was defined before M1, hence we can say that M1 has overloaded M2.

17)A "Class" method means a method defined with the keyword "static". Static methods can be accessed directly via Class(answer D). Hence, doesnt need an object to be created