Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Do API contain only interfaces? Can't it contain classes also?

I am new to API(Application Programming Interfaces). I want to ask whether API is a subset of Interfaces. Can API contain classes? Also I came to know that APIs are used to build functionalities for carrying out say a communication between two layers. This functionality building is explicitly through interfaces only or any class is also used?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Your API is the set of public things exposed to users of your code, and the contracts they guarantee and document. It includes public classes, public constructors, public methods, public interfaces (and all interface methods, since they are definitionally public), public enums, public fields, etc.

Since classes can be public, they can be part of your API.

(I think you’re significantly overcomplicating the concept of an API for yourself.)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading