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).
Escuela, estudio y materia
- Institución
- CSE 2221
- Grado
- CSE 2221
Información del documento
- Subido en
- 25 de mayo de 2024
- Número de páginas
- 14
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
cse 2221 exam study guide
Documento también disponible en un lote