Final - CS 180 Fall 2006 Final Exam There are 30 multiple...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 180 Fall 2006 Final Exam There are 30 multiple choice questions. Each one is worth 3 points. There are 5 program- ming questions worth a total of 110 points. Answer the multiple choice questions on the bubble sheet given and the programming questions on the exam booklet. Fill in the Instructor, Course, Signature, Test, and Date blanks. For “Instructor” put your Recitation Instructor’s last name. For “Course” put CS 180. For “Test” put Final. Fill in the bubbles that correspond to your name, section and Student ID in the bubble sheet. For your section number, use 0830, 0930, 1030, 1130, . .. – based on the start time of your Friday recitation. Consult the following list: 08:30 recitation in LWSN B134: Elizabeth Blythe 09:30 recitation in LILY G401: Matt Carlson 10:30 recitation in LILY G424: Matt Carlson 10:30 recitation in CIVL 1266: Alvin Law 11:30 recitation in REC 122: Alvin Law 12:30 recitation in LILY G424: Isuru Ranaweera 01:30 recitation in REC 308: Isuru Ranaweera 02:30 recitation in LWSN B134: Nick Sumner 03:30 recitation in REC 226: Nick Sumner For your student ID, use the 10 digit ID number on your student ID card. DO NOT USE YOUR SOCIAL SECURITY NUMBER! Exams without names will be graded as zero. Only the answers on the bubble sheet will be counted. The questions will be discarded. Recitation Start Time Recitation TA’s Name Student Last Name Student First Name
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Part I. Multiple Choice Questions (3 points each): 1. Which of the following characteristics of an object-oriented programming language restricts behavior so that an object can only perform actions that are defined for its class? (a) Dynamic Binding (b) Polymorphism (c) Inheritance (d) Encapsulation 2. What is the value of the String S after the following line? String S = (new String("arach")).substring(0,2) + (new String("nophobia")).substring(3); (a) "arachobia" (b) "arnophobia" (c) "arhobia" (d) "rachobia" 3. When would you use a private constructor? (a) When you get bored with public (b) If you want to disallow instantiation of that class from outside that class (c) If you want to protect your class’s members from outside modification (d) Never, it’s not allowed 4. Which of the following is true about RuntimeException and its subclasses? (a) If a method throws a RuntimeException, the use of the try/catch block is optional. (b) The FileIOException class is a subclass of RuntimeException. (c) In general, handling of RuntimeException should be done at compile time. (d) In general, RuntimeException must be caught with a try/catch block. 5. Which of the following types cannot be used as the parameter for a switch statement? (a) char (b) boolean (c) byte (d) int 1
Background image of page 2
6. What is the output when you try to compile and run the following code? public class Switch {
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 25

Final - CS 180 Fall 2006 Final Exam There are 30 multiple...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online