API:
api is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you’re using an api.
An application programming interface, or API,Β enables companies to open up their applications’ data and functionality to external third-party developers, business partners, and internal departments within their companies.

Not every site has (or wants) to invest the developer time in creating APIs. Smaller ecommerce sites, for example, may skip creating APIs for their own sites, especially if they also sell through Amazon (who already has their own API).
There are four principal types of API commonly used in web-based applications:Β public, partner, private and composite. In this context, the API “type” indicates the intended scope of use.
TheΒ Google Maps API and Twitter APIΒ may be among the most widely used API examples, but most software-as-a-service (SaaS) providers offer APIs that let developers write code that posts data to and retrieves data from the provider’s site as well.
Create a Network Application in Java
1 – Create a class.
2 – Create a main method.
3 – Declare server address.
4 – Create a server.
5 – Log server inception.
6 – Create a client.
7 – Log connection attempt.
8 – Establish connection.
9 – Log established connection.
10 – Prepare communication streams.
11 – Log that communication is ready.
12 – Create a message.
13 – Send the message.
14 – Log sent message.
15 – Read the message.
16 – Log read message.
17 – Disconnect connections.
18 – Log disconnection.
19 – Terminate server.
20 – Log server termination.
21 – Compile and run