File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes how to use api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to use api" Watch "how to use api" New topic
Author

how to use api

laks subramanian
Greenhorn

Joined: Feb 05, 2002
Posts: 17
Can somebody illustrate the use of API and how one will use it.
thanks in advance
Sigfred Zamo
Ranch Hand

Joined: Mar 04, 2002
Posts: 44
If you are referring to the Sun�s API doc, go to (J2SE 1.4):
http://java.sun.com/j2se/1.4/docs/api/index.html
There you have all the classes and interfaces in alphabetical order, you can access them along the the frames placed at the left side.
�Is this the info u need?


Sigfred Zamo<br />Software Development<p><a href="http://www.sigfredo.ingenieros.net/index2.html" target="_blank" rel="nofollow">My page</a>
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Well - there is some confusion in terminology here. We often refer to the Sun documentation of the API as the API. That is used to read up on what stuff is available from Sun to be used by us folks out here.
Of course TECHNICALLY the API is the code itself. It is that portion of the code that is public, and therefore available to be used by other classes. It is the fields and methods that OUR classes can use to interact with THEIR classes. Their code also contains encapsulated stuff that they do NOT provide access to, so that portion of the code is not part of the "interface" to their code.


"JavaRanch, where the deer and the Certified play" - David O'Meara
laks subramanian
Greenhorn

Joined: Feb 05, 2002
Posts: 17
thanks cindy and sigfred, but an example would be highly appreciated(if possible).
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
An example of WHAT?
You just READ the thing, and then you can use anything of the methods or Fields that it talks about.
For instance if you go to the Integer class (a wrapper class for ints), it shows you all of the methods that Integer types can use.
One of those methods is a static method named parseInt(String s).

parseInt
public static int parseInt(String s)
throws NumberFormatException
Parses the string argument as a signed decimal integer. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' ('\u002D') to indicate a negative value. The resulting integer value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseInt(java.lang.String, int) method.
Parameters:
s - a String containing the int representation to be parsed
Returns:
the integer value represented by the argument in decimal.
Throws:
NumberFormatException - if the string does not contain a parsable integer.


After reading that I know that I can do
String myString = "10";
int i = Integer.parseInt(myString);
and i now holds the int value 10.
[ April 16, 2002: Message edited by: Cindy Glass ]
laks subramanian
Greenhorn

Joined: Feb 05, 2002
Posts: 17
Thanks Cindy, I got it.
 
jQuery in Action, 2nd edition
 
subject: how to use api
 
Similar Threads
Creating new JFrame on click of JButton
Reflection API
sun's coffee break & saaj
compile error
which version of java supports audio?