CSE 2221 Exam Study Guide | Study Questions with 100% Correct Verified Answers
The Implements Relation - ANSWER The implements relation may hold between a class and an interface. If C implements I then class C contains code for the behavior specified in interface I. This means that C has method bodies for instance methods whose contracts are specified in I. The code of C looks like this: class C implements I { // bodies for methods specified in I } The implements relation allows you to separate contracts from their implementations- a best practice for component design. The Extends Relation - ANSWER The extends relation may hold between: 2 interfaces or 2 classes. If B extends A then B inherits all the methods of A. This means B implicitly starts out with all the method contracts (for an interface) or all the method bodies (for a class) that A has. B can then add more method contracts (for an interface) or method bodies (for a class).
Geschreven voor
- Instelling
- CSE 2221
- Vak
- CSE 2221
Documentinformatie
- Geüpload op
- 25 mei 2024
- Aantal pagina's
- 14
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
cse 2221 exam study guide
Ook beschikbaar in voordeelbundel