Hello all,
This is my first post to
Java Ranch, and frankly I don't understand why this question doesn't get asked a LOT, maybe I have missed something BIG...
How the **** do you guys find your way around the Java API Docs?
Maybe I'm just totally spoiled by other languages' docs, but it seems to me that if I want a class to perform a basic programming function, I should be able to search for the _general_function_ and find a list of applicable classes.
Examples:
Referring to the "JDK 5.0 Documentation" in HtmlHelp format from
http://www.allimant.org/javadoc/index.php 1. Suppose I want to build a
string from a bunch of fragments - I've been told that "abc" + " " + "xyz" is evil...
"Concatenation of localized strings to produce a longer string is not valid because the
word order changes from one locale to the next."
The recommended alternative from this source is "Use the class Message to construct the string..."
A search for "Message" returns a bunch of stuff, but no classes by that name...
A search for the logical "concatenation" returns one entry for "concatenateTransform" (what ever that is - docs go way over my head).
A search for "String" returns a _large_ number of results, none of which mention concatenation. Searching the entry for class "String" finally reveals this:
"String concatenation is implemented through the StringBuilder(or StringBuffer) class and its append method."
But the "append" method is not mentioned further..
Finally, after several hours of frustration and much googling, I discover that the advice I had was in error. The class that assembles locale friendly strings is "MessageFormat".
2. Suppose I want to know about the various Java data types and their memory requirements?
3. The String class has a lot of functionality but apparently converting a string to Title Case is not among them. At least a search within the String class entry for "title case" returns nothing and "case" finds a bunch of entries relating upperCase, lowerCase and caseInsensitve.
The point is, over the last 25 years, I have worked with a variety of languages from 6803 ASM to various flavors of Basic, Pascal, DBase, ColdFusion and PHP. After working my way through "Head First Java", "Head First OOA&D" and working on "Head First Design Patterns", I feel that the API docs represent my steepest learning curve.
I have reviewed the recommendations at
http://faq.javaranch.com/view?JavaApiDocs, but these don't provide much help.
Books:
"Java Almanac" looks good, but is rather out of date.
"Java In A Nutshell" appears to be largely a printed copy of Sun's API docs.
I have learned Java (to some extent), so now how do I quickly find my way around the API?
Thanks for any suggestions.
-Glen
[ March 15, 2007: Message edited by: Glen Ihrig ]