Quiz2 - 1.00/1.001 Introduction to Computers and Engineering Problem Solving Quiz 2 Name Email Address TA Section You have 90 minutes to complete

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 1.00/1.001 Introduction to Computers and Engineering Problem Solving Quiz 2 / November 10, 2005 Name: Email Address: TA: Section: You have 90 minutes to complete this exam. For coding questions, you do not need to include comments, and you should assume that all necessary files have already been imported. Good luck. Question Question 1 Question 2 Question 3 Question 4 Question 5 Total Points / 24 / 30 / 20 / 16 / 10 / 100 1 HW HW2 HW3 HW4 HW5 HW6 Q1 Question 1 True/False 1) A class may extend one or more classes. TRUE FALSE 2) A class may implement one or more interfaces. TRUE FALSE. The following code fragment is associated with problems 3) and 4) public abstract class SomeClass{ public SomeClass(){ //implementation not shown } //remainder of implementation not shown } public interface SomeInterface{ //declarations not shown } 3) The statement SomeClass c = new SomeClass(); will not compile in Java. TRUE FALSE 4) The statement SomeInterface i = new SomeInterface(); will not compile in Java. TRUE FALSE 5) Events in Java are objects that are created by Event Sources (such as JButtons, JPanels, and other Components). TRUE FALSE 6) Each Event Listener (for example, a class that implements the ActionListener interface) can only register to receive Events from one Event Source (for example, one JButton). TRUE FALSE 7) Multiple different Event Listeners can register to receive Events from the same Event Source. TRUE FALSE 8) You want to extend JPanel to make a new class that draws a smiley face in the middle of the JPanel. Where should you put your drawing code? Circle all that choices that apply: a) the repaint() method b) the constructor c) the paintComponent(Graphics g) method d) none of the above Question 2 - Inheritance and Interfaces QuizClass , QuizClass2 and QuizInterface are all in the same package. However, QuizClass and QuizInterface are incomplete. Read and complete the code fragments below for QuizClass and QuizInterface...
View Full Document

This note was uploaded on 11/29/2011 for the course CIVIL 1.00 taught by Professor Georgekocur during the Spring '05 term at MIT.

Page1 / 12

Quiz2 - 1.00/1.001 Introduction to Computers and Engineering Problem Solving Quiz 2 Name Email Address TA Section You have 90 minutes to complete

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