How does the API actually work! I Googled a lot, but the answers are confusing. I know that it is a interface.
For example in Android, if I extend Activity in my code, I could use the API docs to assist me. And what creates the Activity object, i never call new Activity();
What exactly does a API communicate with to achieve the desired results? Is API a class definition?
API is a collection of Classes and Interfaces grouped together mainly according to their functionality.
They are the classes which have the functionality written in them to do things like sorting, making various network connections like Http, ftp connections, File handling .etc..
Example:
java.net will have classes for networking
java.io for various input-output functionality
When using an API class or interface, you either need to write the whole path or use import statement..
Full path:
Import
import java.util.ArrayList ;