The Java platform also provides API support and provides implementations for a number of standard secure communication protocols. The primary protocols used for secure communication are SSL and TLS. Although, SSL and TLS are not the only protocols currently in use for security, they are very common for applications that could involve sensitive data (i.e. passwords etc.). A little knowledge about these protocols will greatly help us in understanding how a secure link between a client and a server is really established. Since, the term privacy (or simply securiy) comes first whenever we talk about general security, we shall also start writing programs for secure communication.
Source: Uttam Kumar Roy (2015), Advanced Java programming, Oxford University Press.