File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes How to use Java documentation 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 Java documentation" Watch "How to use Java documentation" New topic

How to use Java documentation

David Crossett
Ranch Hand

Joined: Feb 05, 2003
Posts: 102
It seems we're getting a rash of people looking for quick and easy answers to their programming problems. Often times, we are directing them to the Java documentation (API) to learn for themselves. Usually that is the first place that I go, but here's my *silly* problem: I'm not quite sure how to read it. It would be great if we could get a bunch of posts on HOW to get through the API to figure what methods are available, how to use them, and what they do. I'm sure eveyone has some different tips and tricks, and any of them would be great! I'm sure there are QUITE a few beginners (including myself) that could benefit from this discussion. To keep things simple, let's keep responses limited to either of these two situations:

I'm using the 'frames' version of the API (installed locally). What tricks can I use to surf the tree? What the best way to figure out how to use API classes? Thanks for the help, guys! (and gals!)

David Crossett
-nothing important to say, but learnin' plenty-
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

The API takes a while to get used to. I bought "Java in a Nutshell" and that helped me. It breaks down the APIs and gives you examples.

Please ignore post, I have no idea what I am talking about.
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

Whenever I want documentation, I go to Google and type "javax.mail.SendFailedException" or whatever class I'm looking for, and the first link is usually Sun's on-line documentation (you may have to change the version numebr in the URL, but that's fine by me...)
If I'm looking for information on a particular package, I do the same, but type the package name instead of the class name. Same results.
If I don't know the package, I come to JavaRanch to ask "what will allow me to do xxx..."
And, if I'm off-line, I refer to my copies of Java In a Nutshell, Java Foundation Classes in a Nutshell, and Java Enterprise in a Nutshell. It's not the same detail of information, but they do provide good overviews and usage examples.

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Usually when I'm stuck it is becasue I know there is method out there and I dont know the exact name or parameters for it. I have this page bookmarked. When I get there I just got to the API link on the left. If after reading the API I'm still confused or unsure I can go back and use on of the tutorials to find an example of what I'm looking to use.
I normally use the framed version and use the entire list of all classes and just scroll through it.
Biggest tip when looking for a method is not to forget to look at the inherited methods section in the API.

Steve Fahlbusch

Joined: Sep 18, 2000
Posts: 602

In the courses I instruct, I have the students actually download a copy of API docs to their pc so it will be handy and I reqire that they document to the javadoc statndards and generate the javadocs for everything they submit.
I also have a running "suggestion" to them that when the text references a class they have not used that they run out and read the javadocs.
The above sets a context for understanding the API javadocs in two ways - one they know how the docs were created and they start to get used to reading them.
I agree. Here's the link:
subject: How to use Java documentation
It's not a secret anymore!