Lecture_7_Abstract_Data_Type_A
Lecture_7_Abstract_Data_Type_A
Year: Fourth
1. What is an abstraction?
Answer: Abstraction is the process of hiding the complex details of a system while exposing only the
essential and relevant features. Its goal is to simplify interactions and make systems more
manageable.
2. Define object?
Answer: An object is an instance of a class that encapsulates data (attributes) and behaviors
Answer: A Java package is a namespace that organizes classes and interfaces into logical groups.
Its purpose is to prevent name conflicts and make code easier to locate, use, and manage.
4. Name two accessor methods that allow indirect access to hidden data.
- Java
- C++
- Python
- C#
- Ada
Answer: A destructor in C++ is used to release resources such as memory or file handles that were
Answer: Instances of C++ template classes are created by specifying the type to be used with the
8. Describe the two problems that appear in the construction of large programs that led to
- Ensuring data integrity by controlling access and protecting it from unintended interference.
Answer: The primary advantage of using a namespace in C++ is to avoid naming conflicts between
classes or functions, especially when using multiple libraries in the same program.
10. What is the similarity between the class instances of Java and those of C#?