Application and Programming Interface (API)

Java programming topics
Post Reply
User avatar
Face
Major
Major
Posts: 727
Joined: Thu Feb 18, 2010 5:06 pm
Location: SRI LANKA.KANDY.

Application and Programming Interface (API)

Post by Face » Sat May 22, 2010 7:09 pm

Friends...This is from one of my notes of JAVA.I have little problem that I can not understand in the fourth statement...
Java Runtime Environment (JRE)
• The Java Runtime Environment is a set of software provided by Sun Microsystems that allows a computer system to run a Java application.
• It consists of the Java Virtual Machine (JVM) and the Application and Programming Interface (API), a large body ofreusable code that is provided to simplify the programmer's job.Java Runtime Environment (JRE)
• The Java Runtime Environment is a set of software provided by Sun Microsystems that allows a computer system to run a Java application.
• It consists of the Java Virtual Machine (JVM) and the Application and Programming Interface (API), a large body of reusable code that is provided to simplify the programmer's job.
Can you please explain about the fourth statement ...

Need your help..
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Application and Programming Interface (API)

Post by Neo » Tue May 25, 2010 9:15 pm

It consists of the Java Virtual Machine (JVM) and the Application and Programming Interface (API), a large body of reusable code that is provided to simplify the programmer's job.
A JVM is distributed along with a set of standard class libraries that implement the Java API (Application Programming Interface). An API is provided by a computer system, library, or application in order to allow data exchange between them. APIs are bundled together as the Java Runtime Environment.

Read JVM - Java Virtual Machine
User avatar
Face
Major
Major
Posts: 727
Joined: Thu Feb 18, 2010 5:06 pm
Location: SRI LANKA.KANDY.

Re: Application and Programming Interface (API)

Post by Face » Thu May 27, 2010 11:17 am

I knew about the JVM but I was thinking on API.now I got the meaning.I will try to find out some more about it from WKI.

Thank you.
User avatar
Face
Major
Major
Posts: 727
Joined: Thu Feb 18, 2010 5:06 pm
Location: SRI LANKA.KANDY.

Re: Application and Programming Interface (API)

Post by Face » Thu May 05, 2011 11:35 pm

Hey Friends,
when I was searching about API today,I found this topic I started long time ago.I tried with WIKI but still not clear with the topic API.I wanna know about it in simple.Wiki contains complex things.

Can you please give me a simple discription about this,(Not About the JVM about I wanna know about the API )
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Application and Programming Interface (API)

Post by Neo » Fri May 06, 2011 1:56 am

In every computer language, you will find keywords and supporting library functions. Keywords are core language syntaxes where as library functions are made up of those keywords and other semantics of the language. Library functions can be used to ease our work. Otherwise we would have to write everything.

In Java also, there is a set of library functions called Java API to ease your work. For example, if you want to lay a WAV file using a Java program, you don't need to know about the OS commands. Just use javax.sound.sampled API. If you want some security functionality, you can find it under javax.security.

To do that, you always have to import the correct library first.
For example:

Code: Select all

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Arc2D;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import javax.swing.*;
Find a list of Java API functions at http://download.oracle.com/javase/1,5.0/docs/api/.
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: Application and Programming Interface (API)

Post by SemiconductorCat » Sat Sep 24, 2011 9:12 pm

Not sure are you asking about this,

JRE [ Java Runtime Environment ] = JVM [ Java Virtual Machine itself] + Java Core Libraries and support system


Simply if you can't understand that way, think JVM is just as a computer processor or hardware and JRE as a
full computer with firmware. [ primitive BIOS and DOS calls, not naked like just only a processor'].

now what is JDK?
JDK = JRE + Java Compiler +other support build tools [like jdb java debugger] + developer libraries

how 'developer' library is differs from a normal library is developer library have the debugging symbol table [in C++]
however in java there may be more annotations than that.

so what is a library?
Believe me when I'm telling you , I'm really sick of explaining this to ppl who thinks java is the whole universe.
To explain this it's essential to dig into at least "C" program level.
if you have a linux installed machine with gcc , practice there exercises.
http://www.yolinux.com/TUTORIALS/Librar ... namic.html
epically with the tools like 'nm' and 'objdump' and understand how a compiler select a name to function/variable.
it's very important to be a good programmer. And there's no war here, if Java section moderator thinks
this is too native to machine level you are free to remove this post.


So what is API?
Application Programming Interface.
so if you have done BIT 2nd year subject like Object Oriented Analysis and Design then you'd be able to
know what is meant by an interface. This is also harder to explain without going into at least "C" programming
level. BTW , I like to take a simple example for you, think you need to drive a car , and it's obvious that you
don't need to know the how internal combustion engine works in-order to ride the car, instead you should
be familiar with the driving wheel, brake system ,brakes lights horn etc. So that's where the encapsulation
concept comes from.The unnecessary details have been hidden from third party programmers.

In "C" a particular header file is the interface for a library, it contains only the extern prototype for the
function.Read the given link about and there's no use of duplicating information all around the net.If you
don't understand just ask.


Like that Operating Systems Windows /Linux supports API model, in linux it's POSIX and windows it's win32.
When you want to Create a window on the screen you don't need to worry or write the code to
communicate with your graphics card and write to pixel buffers and deal with other input/output registers.
your OS will took care all for ya. so in that case we can say OS is providing an API to the 3rd party
programmer.

In java also the situationist is same,actually JRE is more than a virtual machine ,a virtual machine with a
OS or Firmware installed. And I want to mention also , Java GUI frameworks are not core java libraries,
they are cumming with JRE and JDK yes,and in all machines where java is. But they , SWING /AWT are not
core java libraries.libraries like java.system.* are core java libraries and exists every JRE. basic functions
like standard input /output , memory management ,basic threads , garbage collection help basic os events and signalling are part of a core library. ATW/Swing is a bundled package to the JRE/JDK, because you can see JRE in mobil phones does not have a AWT/SWING.
User avatar
SevenZero
Major
Major
Posts: 263
Joined: Sun Nov 01, 2009 8:37 pm

Re: Application and Programming Interface (API)

Post by SevenZero » Sun Sep 25, 2011 10:27 am

Sandun,

I'm too annoyed by seeing this post. This made me to read all your other posts as well. This is really not good for the reputation of ROBOT.LK members.

Have you read previous answers at all? Don't you see the perfect answer has already been given?

You are simply trying to override all of us here and SHOW UP your bad behaviour all the time. You said you got fired on your job. This is too obvious. You deserve that for your mentality. Neo isn't here, but he asked me to monitor the forum for few days. If it was him, he would give you some more chances, but not me.

These are your rules from here onwards.

* Always read previous answers and see whether you need to add something
* Your intention should be to help the questioner, not to override the other people who answered
* If there are no further questions, do not just try to give your point of view, etc... It's not needed.
* Never confuse our members with invalid or unrelated information

Violation of a single rule will ban your membership from ROBOT.LK and listed on our ban list with reason as trying to disrupt our members. I can't tolerate such a sick mentality.


I'm adding the reasons for my decision. So this is clear to all members including Neo.

Not sure are you asking about this,
Didn't you read above posts. The answer is already there.

Face's question was about API... See what this man has written here
JRE [ Java Runtime Environment ] = JVM [ Java Virtual Machine itself] + Java Core Libraries and support system

Simply if you can't understand that way, think JVM is just as a computer processor or hardware and JRE as a
full computer with firmware. [ primitive BIOS and DOS calls, not naked like just only a processor'].

now what is JDK?
JDK = JRE + Java Compiler +other support build tools [like jdb java debugger] + developer libraries
Any need to take C++ here?
how 'developer' library is differs from a normal library is developer library have the debugging symbol table [in C++]
however in java there may be more annotations than that.
He is sick or else he copy-paste from a sick post
so what is a library?
Believe me when I'm telling you , I'm really sick of explaining this to ppl who thinks java is the whole universe.
Completely unrelated to the question
To explain this it's essential to dig into at least "C" program level. if you have a linux installed machine with gcc , practice there exercises. http://www.yolinux.com/TUTORIALS/Librar ... namic.html epically with the tools like 'nm' and 'objdump' and understand how a compiler select a name to function/variable. it's very important to be a good programmer. And there's no war here, if Java section moderator thinks this is too native to machine level you are free to remove this post.
Luckily Face is also a BIT student. For the people who don't know what is BIT, BIT is an external degree program handled by University of Colombo School of Computing (UCSC). How if this question asked by a self studying student? He simply trying to show that he is doing BIT and bla bla bla... The question asked by Face has nothing to do with a degree. It is just a simple question which covers even in a 3 month Java course.
So what is API?
Application Programming Interface.
so if you have done BIT 2nd year subject like Object Oriented Analysis and Design then you'd be able to know what is meant by an interface. This is also harder to explain without going into at least "C" programming level. BTW , I like to take a simple example for you, think you need to drive a car , and it's obvious that you don't need to know the how internal combustion engine works in-order to ride the car, instead you should be familiar with the driving wheel, brake system ,brakes lights horn etc. So that's where the encapsulation concept comes from.The unnecessary details have been hidden from third party programmers.
Again C...
In "C" a particular header file is the interface for a library, it contains only the extern prototype for the
function.Read the given link about and there's no use of duplicating information all around the net.
What to ask here? It's a Java question and you are the person who took C here. So ask form yourself. There is nothing we have to learn form you.
If you don't understand just ask.
Completely unrelated..
Like that Operating Systems Windows /Linux supports API model, in linux it's POSIX and windows it's win32. When you want to Create a window on the screen you don't need to worry or write the code to communicate with your graphics card and write to pixel buffers and deal with other input/output registers. your OS will took care all for ya. so in that case we can say OS is providing an API to the 3rd party programmer.
Some Java related information... Better than stuff above, but still confusing
In java also the situationist is same,actually JRE is more than a virtual machine ,a virtual machine with a OS or Firmware installed. And I want to mention also , Java GUI frameworks are not core java libraries, they are cumming with JRE and JDK yes,and in all machines where java is. But they , SWING /AWT are not core java libraries.libraries like java.system.* are core java libraries and exists every JRE. basic functions like standard input /output , memory management ,basic threads , garbage collection help basic os events and signalling are part of a core library. ATW/Swing is a bundled package to the JRE/JDK, because you can see JRE in mobil phones does not have a AWT/SWING.
Post Reply

Return to “Java Programming”