Definition: API stands for Application Programming Interface. An API is the definition of how a programmer can access the functionality contained within a code library.
Examples:
Java comes with many code libraries that provide pre-written functionality for programmers. For example, Swing is a user interface code library:
import javax.swing.*;
Swings API provides the access to the graphical components in Swing.

