Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Interfaces and all that, Quizzes of Computer Science

Material Type: Quiz; Professor: Lane; Class: Design of Large Programs; Subject: Computer Science; University: University of New Mexico; Term: Unknown 1989;

Typology: Quizzes

Pre 2010

Uploaded on 07/22/2009

koofers-user-tr8
koofers-user-tr8 🇺🇸

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Interfaces and all that;
Thoughts on Hashing
Ch. 6
pf3
pf4
pf5

Partial preview of the text

Download Interfaces and all that and more Quizzes Computer Science in PDF only on Docsity!

Interfaces and all that;

Thoughts on Hashing

Ch. 6

Quiz directions

Individual section

Circle correct answer for each question

You get 2 tries for each question

Correct on 1st try (top line): 3 pts

Correct on 2nd try (bottom line): 1 pt

Keep your answers! (On quiz sheet)

Hand in sheet when complete

Group section

Start when all members of group are done w/ individual

Again, 2 tries

Grade yourselves as you go along

Hand in final group sheet

Why all the complexity?

Why two interfaces, an abstract class, and a bunch of concrete classes?

Common OO design principle

Interface : provides a contract or specification of what an object should be able to do

Has no data of its own

AbstractClass : provides “most” of the implementation of an interface

Takes grunt work out of instantiating an interface

May not be the most efficient possible

Concrete Class : provides everything necessary to use

Interchangability

Common view of interfaces:

“Interfaces are Java’s kludge to get around the lack of multiple inheritance”

WRONG!

(mostly)

Interfaces describe properties of a thing -- how you can use it

Any two objects that obey the same interface are (should be) semantically interchangeable

Can plug either in to same place and have function of program remain same

They may support diff extra stuff, side effects, have different efficiencies, etc.