Are methods and APIs, basically the same in Java? If no, what makes them different?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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)