TAILIEUCHUNG - Lecture Data visualization - Chapter 13

In this lecture we learned about: Separation of interface and implementation, objects are declared as primitive type, the destructor operator, copy constructor, default constructor. | Lecture 13 Recap Separation of Interface and Implementation Objects are Declared as Primitive Type The Destructor Operator Copy Constructor Default Constructor Selective Questions from Exercise Q: What is information hiding? What is encapsulation? How does C++ support these concepts? Answer: Information hiding makes implementation details, including components of an object, inaccessible. Encapsulation is the grouping of data and the operations that apply to them to form an aggregate while hiding the implementation of the aggregate. Encapsulation and information hiding are achieved in C++ through the use of the class. Q: Explain the public and private sections of the class. Answer: Members in the public section of a class are visible to non-class routines and can be accessed via the. member operator. Private members are not visible outside of the class. Q: Describe the roles of the constructor and destructor. Answer: The constructor is called when an object is created, either by declaration, a call to new, or as a member of an object which itself is being constructed. The destructor is called when the object exits scope, either because it is a local variable in a terminating function, it is subject to a delete, or it is a member of an object whose destructor is called. Q: What is the difference between a copy constructor and a copy assignment operator? Answer: The copy constructor creates and initializes a new object. It is used to implement call by value. The copy assignment operator copies into an already existing object. Q: If a class provides no constructor and no destructor, what is the result? Answer: The default constructor is a member-by-member application of a default constructor. The default destructor is a member-by-member application of a destructor. Chapter 4 Inheritance Introduction In this chapter we will study how the general principles of inheritance and the object-oriented concept of polymorphism relate to code reuse, how inheritance is .

TÀI LIỆU MỚI ĐĂNG
8    164    3    28-12-2024
11    168    2    28-12-2024
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.