quiz2 - 1.00/1.001 Introduction to Computers and...

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

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 2
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,
Image of page 3

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern