COE318 \u2013 Fall 2010 Final (Solutions) - Ryerson University Department of Electrical Computer Engineering COE318 Final Examination Dec 14 2010 Name

COE318 u2013 Fall 2010 Final (Solutions) - Ryerson...

  • Ryerson University
  • COE 318
  • Test Prep
  • Pakistani
  • 13
  • 100% (1) 1 out of 1 people found this document helpful

This preview shows page 1 - 4 out of 13 pages.

1 Ryerson University Department of Electrical & Computer Engineering COE318 Final Examination Dec. 14, 2010 Name:________________________ Section:______________ ID #: _________________________ Time: 3 hours Circle the name of your Professor: K. Clowes, O. Das, T. Yang. Instructions This exam is 3 hours long. It contains 9 questions. Please check your copy to make sure that it contains 13 pages (including this page) before you start. (1) This is a closed-book exam. (2) If in doubt on any question, then you must clearly state your own assumption(s). (3) For each question, you must show your steps and reasoning clearly to be awarded part marks for your answer. For marking use only (do not fill) Questions Score Max 1 6 2 10 3 14 4 10 5 10 6 15 7 10 8 15 9 10 Total 100
Image of page 1
2 Q1. Consider the following Java code: (6 marks) try { System.out.println(11); try { System.out.println(12); f(); System.out.println(13); } catch (E1 e1) { System.out.println(14); } finally { System.out.println(15); } } catch (E2 e2) { System.out.println(16); } Note that f()does not generate any output.Indicate the output of this code for the cases where (a) there is no exception, (b) fthrows exception (a) (b) Q2. True/False (10 marks) For each of the following questions about Java, circle T (true) or F (false) T / F You can write a constructor for an abstract class. E1 T / F You can create an instance of an abstract class. You can declare a constructor in an interface. T / F Classes, methods, and instance variables can all be declared final. T / F A class can extend only one other class. T / F A class can implement at most one interface.
Image of page 2