什么是Java API?

发布于 2024-10-09 10:10:14 字数 57 浏览 0 评论 0原文

我知道 API 是一组规则和协议。任何人都可以用示例向我解释什么是 Java API 及其功能...

I know API is a set of rules and protocols.can anyone explain me with example what is a Java API and its functionality...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

苦行僧 2024-10-16 10:10:14

您可以在这里找到 Java API http://download.oracle.com/javase /6/docs/api/index.html

你可以说它是 Java 库,你可以像使用软件的构建块一样使用它,这样可以加快你的开发速度。

例如:

ArrayList 是 API 中的 gazilion 类之一。

import java.util.ArrayList; // We say the old mighty compiler that we want to use this class

// we create an ArrayList object called myList that will hold objects of type Beer
ArrayList<Beer> myList = new ArrayList<Beer>();

Beer b = new Beer();

myList.add(b); // the class ArrayList has a function add, that adds an object(a Beer);

myList.size(); // will give you the size of the ArrayList. 

myList.remove(b); // will remove our beloved Beer :)

如果您想知道还可以使用 ArrayList 做什么,您应该查看 API 或在输入 myList 时。 CTRL + SPACE 将为您提供所有可用的功能:)

祝您好运!

You can find Java API here http://download.oracle.com/javase/6/docs/api/index.html

You could say it is the Java library and you can use it like building blocks for your software and that way speed up your development.

For example:

ArrayList is one of the gazilion classes in the API.

import java.util.ArrayList; // We say the old mighty compiler that we want to use this class

// we create an ArrayList object called myList that will hold objects of type Beer
ArrayList<Beer> myList = new ArrayList<Beer>();

Beer b = new Beer();

myList.add(b); // the class ArrayList has a function add, that adds an object(a Beer);

myList.size(); // will give you the size of the ArrayList. 

myList.remove(b); // will remove our beloved Beer :)

If you want to know what else can you do with the ArrayList you should check out the API or when typing myList. CTRL + SPACE will give you all the functions avaible :)

Good luck!

不美如何 2024-10-16 10:10:14

正是您所描述的,仅适用于 Java 语言。

Java API 是标准 Java 发行版中的一组库,称为 JRE(Java 运行时)。因此,每次您使用诸如 Integer 之类的东西作为表示整数的类时,您都在使用 Java 的 API。

但由于 Java 如此广泛,并且各种发行版(Java SE、Java EE、Java ME)之间的界限乍一看并不总是清晰,因此术语“Java API”可能会产生误导。

因此,请将其视为将代码传达给 Java 库的方式。

Exactly what you described, just for the Java language.

Java API is a set of libraries that are found in the standard Java distribution, and is called the JRE (Java Runtime). So, every time you use something like Integer as a class for representing integers, you're using Java's API.

But since Java is so broad, and boundaries between various distributions (Java SE, Java EE, Java ME) aren't always clear at first sight, the terminology "Java API" might be misleading.

So, treat it as the way you communicate your code to Java's libraries.

巨坚强 2024-10-16 10:10:14

一般 API 说明

JAVA API

简而言之,API 从用户的角度用作该特定语言中可用的类和方法的参考

general api explanation

JAVA API

In a nutshell, the API is used from a user point of view as the reference which classes and methods are available in this specific language

情仇皆在手 2024-10-16 10:10:14

JAVA API是可用于创建程序的类和函数的集合......

编程语言是计算机程序语言的通用术语。 ...而 API 是使用函数和类实现的实际功能集的技术术语...

Java API 是使用 JAVA JDK(Java 开发工具包) 来自Oracle/Sun

The JAVA API is a collection of classes and functions that can be used to create programs....

A programming language is a general term for a computer-program language.....while API is the technical term for the actual set of features implemented using functions and classes...

The Java API is implemented using the JAVA JDK(Java Development Kit) from Oracle/Sun.

无尽的现实 2024-10-16 10:10:14

简单来说,
Java API 是 JDK 附带的集成软件。 Java中的API提供了两个不同应用程序之间的接口并建立通信。
我建议您查看以下视频,其中有深入的解释。

https://www.youtube.com/watch?v=u4tw-cIJFuo

In simple,
Java APIs are integrated pieces of software that come with JDKs. APIs in Java provides the interface between two different applications and establish communication.
I suggest you to check the following vedio which explains deeply.

https://www.youtube.com/watch?v=u4tw-cIJFuo

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文