API refers to Application Programming Interface, what the rest of the world see and can use.
Method can be part of the public interface or not. But API is really set of methods.
The most common thing related to APIs in java would be Interface which is really set of public method declarations.
Another useful way how to look on API is to take it as contract. Lets take a List interface as an example. It tells you method signatures you can use in a List and in javadoc you see what is the contract (what you can expect and what you need to ensure so the List behaves as expected)
No comments:
Post a Comment