Docsity

Testing and Debugging, Interfaces and Polymorphism - Lecture Combined | CS 162, Exams of Computer Science

Toggle sidebar
bg1
CS 162 Spring 2005 Midterm 1 Topics
Chapter 8: Testing and Debugging
Vocabulary (you should know these terms): Test stub, Test Harness, Test Suite, Unit
Testing, Integration Testing, Regression Testing
What would be good boundary value test cases for the following bit of code
Chapter 9: Interfaces and Polymorphism
Vocabulary: Binding Time, Interface, Polymorphic Assignment, Listener, Inner Class
Explain how the Java Event model works, and how it gets around the Binding Time
problem (that is, the windowing library was written long before your new application was
written).
Chapter 10: The Java Event System
What is a mouse listener? How does a MouseAdapter differ from a MouseListener? Why
would you want to use a MouseAdapter?
In the Java Graphics model explain the relationship between a frame, a panel, and a
listener.
Explain the execution time behavior of the methods repaint and paintComponent.
Chapter 11: Inheritance
How is the use of inheritance of classes similar to the use of interfaces? how are they
different? What does polymorphism mean for classes?
What does the keyword final mean? What is the difference between the operator – and
the method equals?
Chapter 12: Graphical User Interfaces
What does a layout manager do? How do you attach a listener to a component?
pf2

Partial preview of the text

Download Testing and Debugging, Interfaces and Polymorphism - Lecture Combined | CS 162 and more Exams Computer Science in PDF only on Docsity!

CS 162 Spring 2005 Midterm 1 Topics

Chapter 8: Testing and Debugging

Vocabulary (you should know these terms): Test stub, Test Harness, Test Suite, Unit Testing, Integration Testing, Regression Testing What would be good boundary value test cases for the following bit of code

Chapter 9: Interfaces and Polymorphism

Vocabulary: Binding Time, Interface, Polymorphic Assignment, Listener, Inner Class Explain how the Java Event model works, and how it gets around the Binding Time problem (that is, the windowing library was written long before your new application was written).

Chapter 10: The Java Event System

What is a mouse listener? How does a MouseAdapter differ from a MouseListener? Why would you want to use a MouseAdapter? In the Java Graphics model explain the relationship between a frame, a panel, and a listener. Explain the execution time behavior of the methods repaint and paintComponent.

Chapter 11: Inheritance

How is the use of inheritance of classes similar to the use of interfaces? how are they different? What does polymorphism mean for classes? What does the keyword final mean? What is the difference between the operator – and the method equals?

Chapter 12: Graphical User Interfaces

What does a layout manager do? How do you attach a listener to a component?

Chapter 13: Arrays

What is a partially filled array? How is a Vector similar to an array? How is it different? What two values are maintained internally within a Vector? Why does a vector store values in variables of type Object? What is a wrapper class?

Programming questions:

Write a small bit of code that uses a timer (say, to count down from 10). Write the implementation of add for the class Vector. Write a mouse listener that prints the coordinates of a mouse down. Place buttons around a panel that print something when they are pressed. Using a vector, read values from a file and compute their average.