CMSC 132 Exams(with answered solutions)
object-oriented programming correct answers takes advantage of abstraction and encapsulation abstraction correct answers provides high level model of activity of data, what it does procedural abstraction correct answers specifies what actions should be performed, hide algorithms example: sort numbers in an array data abstraction correct answers specifies data objects for a problem, hide representation example: list of names abstract data type correct answers implementation independent of interfaces example: the ADT is a map, we know it should associate a key with a value encapsulation correct answers a design technique that calls for hiding implementation details while providing an interface for data access example: use the keyword private when designing Java classes abstraction and encapsulation example correct answers abstraction of a roster: data: - list of names actions: - create roster - add student - remove student - print roster encapsulation: only these actions can access names in roster interfaces correct answers specifies a contract, provides abstract methods, defines an IS-A relationship - cannot be instantiated, you can only create an instance of a class that implements the interface implementation: public interface className{
Información del documento
- Subido en
- 29 de mayo de 2024
- Número de páginas
- 10
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas