Java 文法: abstract interface和interface的區別

來源:互聯網
上載者:User
 

interface 本身就是abstract的,只不過沒有明確的規定出來,說一定要把abstract這個關鍵字寫上。
所以abstract interface 就是interface,兩者根本沒有區別。
在《java in a nutshell》裡,
“All methods of an interface are implicitly abstract, even if the abstract modifier is omitted. ”
在《thinking in java》裡,
the abstract keyword, which allows you to create one or more methods in a class that have no definitions
—you provide part of the interface without providing a corresponding implementation, which is created by inheritors. 
The interface keyword produces a completely abstract class, one that provides no implementation at all.

所以結論就是 abstract interface 就是interface,兩者根本沒有區別。

本文轉帖自:http://www.blogjava.net/gembin/archive/2008/03/21/187746.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.