Java - API - Class Library

Java Conceptuel Diagram

About

Classes, interfaces, constructors, members, and serialized forms are collectively known as API elements.

A class whose implementation uses an API is a client of the API. An exported API consists of the API elements that are accessible outside of the package that defines the API.

A class library (a set of packages and method) suitable for use in your own applications is known as the “Application Programming Interface”, or “API” for short.

In general, it is good API design practice not to make users pay for a feature they don't use.

An example would be a package of PDF processing methods that you want use to read PDF data (Tika for instance). A third party has written classes to implement an interface, which it makes public. You will invokes the public PDF methods using the signatures and return types defined in the interface.

While the PDF API is made public (to its user), the implementation of the API is unknown and may be revised at a later date as long as it continues to implement the original interface that the users have relied on.

APIs are then common in commercial software products. Typically, a company sells a software package that contains complex methods that another company wants to use in its own software product.

API

Java

The Java platform provides an enormous API. Its packages represent the tasks most commonly associated with general-purpose programming.

For example:

  • a String object contains state and behavior for character strings;
  • a File object allows a programmer to easily create, delete, inspect, compare, or modify a file on the filesystem;
  • a Socket object allows for the creation and use of network sockets;
  • various GUI objects control buttons and checkboxes and anything else related to graphical user interfaces.

There are literally thousands of classes to choose from. This allows you, the programmer, to focus on the design of your particular application, rather than the infrastructure required to make it work.

As a programmer, The Java Platform API Specification will become your single most important piece of reference documentation. contains the complete listing for all packages, interfaces, classes, fields, and methods supplied by the Java Platform 6, Standard Edition

Library

@API(since = "1.22", status = API.Status.EXPERIMENTAL)
public interface Closeable extends AutoCloseable {
  // override, removing "throws"
    @Override void close();
}

Documentation / Reference





Discover More
Thomas Bayes
Data Mining - Java API for data mining (JDM)

JDM 1.0 is an industry standard Java API for data mining, developed under the Java Community Process (JCP). It defines Java interfaces that vendors can implement for their Data Mining Engines. Not really...
Card Puncher Data Processing
Design Pattern - Facade

API A facade API with a interface in Java Facade_pattern
Java Conceptuel Diagram
Java

Why has become so popular among application developers? Primarily because makes application developers more productive. It is a modern, robust, object-oriented language. ’s unprecedented popularity...
Java Conceptuel Diagram
Java - Interface (Class) - Data Encapsulation

see In the Java programming language, an interface is a reference type, similar to a class, that can contain only: constants, method signatures, and nested types. There are no method bodies....
Java Conceptuel Diagram
Java - Java Executable (Java.exe or Javaw.exe)

See The standard launcher command (java or javaw.exe) in JDK or JRE is no more than a simple C program linked with the Java Virtual Machine. The launcher parses the command line arguments, loads the...



Share this page:
Follow us:
Task Runner