satheesh.droid
satheesh.droid

Reputation: 31567

what is 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...

Upvotes: 3

Views: 10993

Answers (5)

NAJEEB
NAJEEB

Reputation: 3

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

Upvotes: 0

quamaniestoria
quamaniestoria

Reputation: 1

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.

Upvotes: 0

Marcus Maxwell
Marcus Maxwell

Reputation: 1211

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!

Upvotes: 3

Thomas Kremmel
Thomas Kremmel

Reputation: 14783

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

Upvotes: 0

darioo
darioo

Reputation: 47213

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.

Upvotes: 2

Related Questions