Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the API  RSS feed

 
Varuna Seneviratna
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java SE API

The Java SE application programming interface (API) defines the manner by which an applet or application can make requests to and use the functionality available in the compiled Java SE class libraries. (The Java SE class libraries are also part of the Java SE platform.)

The above description is given in the technologies tab of Java SE section(http://java.sun.com/javase/technologies/index.jsp#javasemap).Are the Java SE compiled set of classes the API or if not what?
According to the above descriptin the API defines the manner how a request should be made from the Run time, this implies that the precompiled set of classes and the API are two things.
Until now I was of the opinion that the API is the set of precompiled classes that can be used to create a program without reinventing the weel.After reading this I am confused.

1 Please explain to me What is the API?
2 If "System.out.println("Hello");" is used and compiled .
Please explain How the compiled part of "System.out.println("Hello");" in the class file is excecuted by the Java Run Time
 
Campbell Ritchie
Marshal
Posts: 55681
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not going in for asking little questions, are we?

There seem to be different definitions of API which in the Java world means Applications Programming Interface, ie the classes which are provided by the standard Java implementation. Note that there are other similar or analogous APIs supplied by other people, eg the Apache project.
There seem to be different meanings in different context; I did a Google search and found several different meanings, none of them would have been worth quoting to you.
Each class has a public interface, which consists of the headings of its public fields and methods along with their documentation comments (often loosely called Javadoc). This specifies how other classes can communicate with them.

There are lots of descriptions of how the JVM works on the net; I like this one from BCEL. Look for section 2. See whether that helps with your 2nd question.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!