You control inheritance by creating an inheritance hierarchy. Once you dịch - You control inheritance by creating an inheritance hierarchy. Once you Việt làm thế nào để nói

You control inheritance by creating

You control inheritance by creating an inheritance hierarchy. Once you define
which classes are superclasses and which classes are their subclasses, inheritance
automatically occurs.
For example, all the features of Account are also present in SavingsAccount,
CheckingAccount and MortgageAccount. Figure 2.5 expands on Figure 2.4, showing
a variety of attributes and operations possessed by Account that would also be
inherited by the three subclasses. Attributes are shown in the middle of the class
box; operations are shown at the bottom. The inherited features are not
explicitly shown in the subclasses to make the diagram clearer; however, any
new features exclusive to each subclass are shown.
Organizing classes into inheritance hierarchies is a key skill in object-oriented
design and programming. It is easy to make mistakes and create invalid
generalizations. One of the most important rules to adhere to is the isa rule. The
isa rule says that class A can only be a valid subclass of class B if it makes sense,
in English, to say, ‘an A is a B’. For example it makes sense to say ‘a SavingsAccount
is an Account’ ; it does not make sense to say the inverse, ‘an Account is a
SavingsAccount’. You should test all superclass–subclass pairs (generalizations)
against the isa rule. It is for this reason that inheritance hierarchies are often
called isa hierarchies.
When you detect a violation of the isa rule, it is a clear indication that you have
made an invalid generalization. However, not all cases where the isa rule holds
are good generalizations. Other important points you should check are:
■ If you have given the subclass or superclass ambiguous names (such as ‘Bus’ as
described earlier), you will often create bad generalizations.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
You control inheritance by creating an inheritance hierarchy. Once you definewhich classes are superclasses and which classes are their subclasses, inheritanceautomatically occurs.For example, all the features of Account are also present in SavingsAccount,CheckingAccount and MortgageAccount. Figure 2.5 expands on Figure 2.4, showinga variety of attributes and operations possessed by Account that would also beinherited by the three subclasses. Attributes are shown in the middle of the classbox; operations are shown at the bottom. The inherited features are notexplicitly shown in the subclasses to make the diagram clearer; however, anynew features exclusive to each subclass are shown.Organizing classes into inheritance hierarchies is a key skill in object-orienteddesign and programming. It is easy to make mistakes and create invalidgeneralizations. One of the most important rules to adhere to is the isa rule. Theisa rule says that class A can only be a valid subclass of class B if it makes sense,in English, to say, ‘an A is a B’. For example it makes sense to say ‘a SavingsAccountis an Account’ ; it does not make sense to say the inverse, ‘an Account is aSavingsAccount’. You should test all superclass–subclass pairs (generalizations)against the isa rule. It is for this reason that inheritance hierarchies are oftencalled isa hierarchies.When you detect a violation of the isa rule, it is a clear indication that you havemade an invalid generalization. However, not all cases where the isa rule holds
are good generalizations. Other important points you should check are:
■ If you have given the subclass or superclass ambiguous names (such as ‘Bus’ as
described earlier), you will often create bad generalizations.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Bạn kiểm soát thừa kế bằng cách tạo ra một hệ thống phân cấp thừa kế. Một khi bạn xác định
được các lớp học là superclasses và những lớp là lớp con của họ, thừa kế
tự động xảy ra.
Ví dụ, tất cả các tính năng của tài khoản cũng có mặt trong SavingsAccount,
CheckingAccount và MortgageAccount. Hình 2.5 mở rộng trên hình 2.4, cho thấy
một loạt các thuộc tính và các hoạt động sở hữu bởi tài khoản cũng sẽ được
thừa hưởng bởi ba lớp con. Các thuộc tính được thể hiện ở giữa lớp
hộp; hoạt động được hiển thị ở phía dưới. Các tính năng được thừa kế không
thể hiện rõ ràng trong các lớp con để làm cho sơ đồ rõ ràng hơn; Tuy nhiên, bất kỳ
tính năng mới độc quyền cho mỗi lớp con được hiển thị.
Tổ chức các lớp học vào phân cấp thừa kế là một kỹ năng quan trọng trong hướng đối tượng
thiết kế và lập trình. Nó rất dễ dàng để làm cho những sai lầm và tạo ra không hợp lệ
khái quát. Một trong những nguyên tắc quan trọng nhất để tuân thủ chính là quy tắc isa. Các
quy tắc isa nói rằng lớp A chỉ có thể là một lớp con của lớp B có giá trị nếu nó làm cho tinh thần,
bằng tiếng Anh, nói: "A là B '. Ví dụ nó làm cho tinh thần để nói 'một SavingsAccount
là một tài khoản "; nó không có ý nghĩa để nói nghịch đảo, 'một tài khoản là một
SavingsAccount'. Bạn nên kiểm tra tất cả các cặp cha-subclass (khái quát)
chống lại sự cai isa. Chính vì lý do này mà phân cấp thừa kế thường được
gọi là hệ thống phân cấp isa.
Khi bạn phát hiện một hành vi vi phạm các quy tắc isa, đó là một dấu hiệu rõ ràng rằng bạn đã
thực hiện một sự tổng quát không hợp lệ. Tuy nhiên, không phải tất cả các trường hợp quy tắc isa giữ
là những khái quát tốt. Điểm quan trọng khác, bạn nên kiểm tra là:
■ Nếu bạn có cho các lớp con hoặc tên lớp cha không rõ ràng (như 'xe buýt' như
mô tả ở trên), bạn sẽ thường tạo ra những khái quát xấu.
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2024 I Love Translation. All reserved.

E-mail: