100%(7)7 out of 7 people found this document helpful
This preview shows page 1 - 3 out of 6 pages.
COMP 2150 Object Orientation; Term Test 2; March 9, 2018; A01 2:30-3:20 pm Student Number: _______________________ (write your name on the last page) INSTRUCTIONS 1. Make sure your student number is written above. Write your name on the last page of the test. 2. Answer all questions on the paper. 3. No aids permitted (e.g. no calculators, no books). Turn cell phones off, and keep them out of sight. 4. Time allotted: 50 minutes. Multiple choice Predict the output Short Answer C++ Programming Total /4 /4 /4 /8 /20 Section A: Multiple choice (4 x 1 mark) For each question, select the best answer (only one). 1) When you define an instance variable in a subclass that has the exact same name as an instance variable in the parent class, this is called:
a) polymorphism b) redefinition c) shadowing d) overloading e) nightmare 2) Which of the following is not possible in Java (considering a recent version of Java, e.g. 1.8)? 3) Which of the following signatures corresponds to a copy constructor in C++, for a class named MyClass? 4) Which of the following statements is FALSE?
COMP 2150 Object Orientation; Term Test 2; March 9, 2018; A01 2:30-3:20 pm Section B: Predict the output (4 x 1 mark)