Why API called the application programming interface? Why is the interface? The inside of the API is not a class library, he method is abstract? If not all abstract, why call interface?
CodePudding user response:
The API is not a class library? Is not it is a set of methods said the definition of a certain ability to standardize programming it is not necessarily the abstract suggests that it should have these methods only For example windos we write the program cannot directly call the kernel hardware But by the operating system provides a good API interface to operate the hardware and system function and so on, Only know that there is no need to worry about this method specific implementation, as long as after operating procedures provide the API Don't have to change our program can also run, doesn't it is Java cross-platform program written in your windos Linux can run (if you want to install environment) Why? Because the JVM is to provide our API implementation Because as we don't have to pipe the underlying implementation interface,
CodePudding user response:
The concept and Java interface is different, The things you want to call others (called the application), others must provide methods to will you be able to call you, others to provide you with this method, call interface, is the concept of the meaning of the interface is more widely than Java (can be understood as the interface is A method, including the abstract and not abstract), so often hear some people say that project to project B docking, docking? It needs to provide docking interface of the project, so the concept of the interface so come, the concept of the interface itself is in order to more image system (or application) is exposed to the outside world (or provide for the use of the outside world) entrance, like the computer motherboard, it provides the slot of the CPU, graphics card slot, memory stick slot and so on, these slot call interface, is the mainboard developers in order to let the user can use the mainboard and open to the user's entry, likewise, for the software, the developer of the application in order to let user can invoke its application, also need to provide users with calls its method and the entrance, the entrance are collectively referred to as interface,