Java API和库有什么区别? [英] What is the difference between a Java API and a library?

查看:407
本文介绍了Java API和库有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道API被称为一组函数,用于调用某些东西,而库是一个类的集合,但实际上API是什么,如 java.lang ?我可以在不使用任何API的情况下连接到像 System 这样的类,那么为什么我们说J2SE API而不是J2SE包呢?

I know that an API is called a set of functions used to call something, and a library is a collection of classes, but what is actually API in package like java.lang? I can connect to a class like System without using any API here, so why we say as J2SE API rather than J2SE packages?

推荐答案

直接来自维基百科


在计算机科学中,应用程序编程接口(API)是一个接口,用于定义应用程序可以从库请求服务的方式

In computer science, an application programming interface (API) is an interface that defines the ways by which an application program may request services from libraries

Java包含这些包中的许多库(Swing等),以及 API 是我们请求服务(执行操作等)的接口。

Java contains many libraries in those packages (Swing, etc.), and the API is the interface by which we request services (perform actions, etc.).

这篇关于Java API和库有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆