How to use the Java API Documentation

How to use the Java API Documentation thumbnail
The API Documentation of the Standard Java Library

Sometimes when you're just starting out programming and you just can't figure out how to make Java do exactly what you want it to, what you really need to do is check the Java API Documentation. You can search through all the classes and methods in the Java library, and I'm going to show you exactly how to do it.

Things You'll Need

  • A Web Browser (Which apparently you already have)
Show More

Instructions

    • 1

      First head over to the latest version of the Java API Documentation at http://java.sun.com/j2se/1.5.0/docs/api/. This document holds every standard class in the java programming language. Remember, it's much better to check this for what you might need than to try to memorize all of it. There are literally thousands of classes, let alone methods, you'd have to memorize.

    • 2
      Scroll through and check out anything that might look useful.

      You may or may not know exactly what you need. Determine in general what you need your code to do and look through the API for something that sounds like it may be able to do what you want. For example, if you need the user to be able to click something in your GUI you might look for something like "button". You could scroll down until you came to "JButton" and you might want to check it out, sounds like it could be what you were looking for! This step could be long and grueling, but it's pretty much just how you have to learn it. Wish it were easier.

    • 3
      Look through the class you found for methods you can use, as well as how the constructor can be used.

      If you could find the class you needed in the last step, all you have to do is look through for the methods from it you might need. This page shows quite a few other helpful things like classes it extends (if a class is imported it also imports the methods of all classes it extends) and implements. For example, in the case above supplying the JButton class with a parameter "String text" could be nice to know if you want to label the button.

Tips & Warnings

  • Have patience, the more you learn the less you'll have to look up.

  • Don't be afraid to look stuff up, that's what it's there for.

Related Searches:

Resources

  • Photo Credit java.sun.com

Comments

  • C. K. Schicktanz Feb 12, 2009
    Thanks for the useful article!

You May Also Like

  • How to Download Java API Documentation

    API stands for Application Programming Interface. The API of a programming language is almost always the first place you'll look if you...

  • How to Install Java API

    An API, or application programming interface, is a bundle of libraries and applications that allows a user to write and run code...

  • API Gate Valve Components

    API Gate Valve Components. Valves made to the specifications of the American Petroleum Institute are called API valves. Often used in petroleum...

  • How to Use Java in PDF Forms

    Adobe Portable Document Format (PDF) is one of most prevalent format for presenting and exchanging documents and forms. It was originally a...

  • How to Use a Heapsort in Java

    The heapsort algorithm is one of the fastest sorting algorithms available. Programmers use heapsort in Java because it's a good choice for...

  • Java Image API Tutorial

    The Java API provides you with a large library of standard classes that exist to make tasks--which would be complicated and time-consuming...

  • How to Use Request Object in Java

    Java Server Pages (JSPs) are designed to run from a Web server and give Java programmers the ability to dynamically create Web...

  • How to Unlock the Java API on My Motorola L2

    Java applications, popular features on Motorola phones such as the L2, are used for different tools and resources. These apps enhance your...

  • Java Quicktime Tutorial

    Java is a popular platform and programming language. QuickTime is Apple's multimedia software platform that allows audio and video creation and publishing....

Related Ads

Featured