TAILIEUCHUNG - Lecture Object oriented programming - Lecture no 18

After you have read and studied this chapter, you should be able to: Manipulate a collection of data values, using an array; declare and use an array of primitive data types in writing a program; declare and use an array of objects in writing a program; define a method that accepts an array as its parameter and a method that returns an array; describe how a two-dimensional array is implemented as an array of arrays; manipulate a collection of objects, using lists and maps. | CSC241: Object Oriented Programming Lecture No 18 Previous lecture Example program – inheritance Relationship between class Association Aggregation Composition ID 6 name ali e c *emp name ali house 0 name Length Name Width Length Name Width 1 rooms[2] Today’s Lecture Default copy constructor Memory management String class using new operator Pointer to object Array of pointers to objects Polymorphism Default Copy constructor Two ways to initialize objects. no-argument constructor Distance d1; multi-argument constructor Distance d2(4, 5,76); An object can be initialize with another object of the same type Distance d1 = d2; A default copy constructor will be called One argument constructor whose argument is an object of same class Cont. If no copy constructor define in class then complier adds default copy constructor When default copy constructor is invoked When object is pass as an argument to a function Distance d1, d2, d3; (d1, d2); When an object is return by value .

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.