What is the Java API?

I know that an API is a set of rules and protocols. Can someone explain to me an example of what the Java API is and its functionality ...

+3
source share
4 answers

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

You could say that it is a Java library, and you can use it as building blocks for your software and thereby speed up development.

For instance:

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 you can do with an ArrayList, you should check the API either when entering myList. CTRL + SPACE will provide you with all the functions available :)

Good luck

+3
source

, , Java.

Java API - , Java, JRE (Java Runtime). , , - Integer , Java API.

Java , (Java SE, Java EE, Java ME) , "API Java" .

, Java.

+2
0

JAVA API - , ....

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

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

0
source

Source: https://habr.com/ru/post/1782770/


All Articles