Effective Java Programming Language Guide phần 7

có chứa một thực hiện mặc định hợp lý. Tất cả các việc triển khai hiện có của các lớp trừu tượng sau đó sẽ cung cấp phương pháp mới. Điều này không làm việc cho các giao diện. Đó là, nói chung, không thể để thêm một phương pháp để một giao diện công cộng mà không vi phạm tất cả các chương trình hiện có sử dụng giao diện. | Effective Java Programming Language Guide A college degree such as B 46 S 46 M 46 S 46 or Ph 46 D. public class Degree . It is somewhat misleading to say that the summary description is the first sentence in a doc comment. Convention dictates that it should seldom be a complete sentence. For methods and constructors the summary description should be a verb phrase describing the action performed by the method. For example ArrayList int initialCapacity Constructs an empty list with the specified initial capacity. Returns the number of elements in this collection. For classes interfaces and fields the summary description should be a noun phrase describing the thing represented by an instance of the class or interface or by the field itself. For example TimerTask A task that can be scheduled for one-time or repeated execution by a Timer. The double value that is closer than any other to pi the ratio of the circumference of a circle to its diameter. The doc comment conventions described in this item are sufficient to get by but there are many others. There are several style guides for writing doc comments Javadoc-a Vermeulen00 . Also there are utilities to check adherence to these rules Doclint . Since release Javadoc has had the ability to automatically reuse or inherit method comments. If a method does not have a doc comment Javadoc searches for the most specific applicable doc comment giving preference to interfaces over superclasses. The details of the search algorithm can be found in The Javadoc Manual. This means that classes can now reuse the doc comments from interfaces they implement rather than copying these comments. This facility has the potential to reduce or eliminate the burden of maintaining multiple sets of nearly identical doc comments but it does have a limitation. Doc-comment inheritance is all-or-nothing the inheriting method cannot modify the inherited doc comment in any way. It is not uncommon for a method to .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
9    66    2    20-05-2024
207    561    4    20-05-2024
17    91    2    20-05-2024
Đã 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.