Home > Java > Javagetting Started > body text

what is api in java

王林
Release: 2019-12-05 14:48:53
Original
8661 people have browsed it

what is api in java

What is API?

API (Application Programming Interface, Application Programming Interface) is a set of predefined functions that are designed to provide applications and developers with the ability to access a set of routines based on certain software or hardware without requiring Access the source code, or understand the details of the inner workings.

JAVA API package

what is api in java

Example:

java.langThe package contains the Java programming language The most basic class. Since the java.lang package is the most frequently used package in Java programming, Java automatically imports the java.lang package for every Java source program by default, and programmers no longer have to explicitly import it manually.

Online learning video tutorial sharing: java learning

Object class:

The Object class is the root of the entire Java class hierarchy Class, all other classes in Java are directly or indirectly inherited (derived) from the Object class.

Only some methods are defined in the Object class, but no properties are defined.

The Object class implements object runtime-related methods, garbage collection methods, and thread synchronization methods.

Commonly used methods of the Object class Example 1:

equals()Method:

public boolean equals(Object obj)
Copy after login

Purpose: Compare two objects for equality.

Input parameters: obj-the reference object for comparison.

Return value: true if the value of the object is the same as the obj parameter; otherwise false

Common methods of the Object class Example 2:

toString()Method:

public String toString()
Copy after login

Purpose: Generally returns a string representing this object as text. The results are given in a short and concise representation so that they are easy for humans to read.

Input parameters: None

Return value: A string representing this object.

Recommended related articles and tutorials: java introductory tutorial

The above is the detailed content of what is api in java. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template