COMP2150_Test2_A01-answers.pdf - 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

COMP2150_Test2_A01-answers.pdf - COMP 2150 Object...

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?
Background image
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)
Background image
Image of page 3

You've reached the end of your free preview.

Want to read all 6 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture