Search code examples
javadocumentationconventions

Where can I find information about conventions used in Oracle's Java documentation?


I'm relatively new to Java, and still run across methods I've never seen before when perusing the Java documentation. I sometimes get confused about the right way to use the methods because I don't know the conventions used by Oracle.

Consider this example from the String class page:

contains(CharSequence s) 
Returns true if and only if this string contains the specified sequence of char values.

I wondered:

Is CharSequence a literal value? Does it represent that the variable s has to be a CharSequence? What's the proper syntax for using this method?

While clarified after further digging, I feel I could have narrowed my search considerably if I'd known of some kind of meta-documentation. It'd be great if there were a document somewhere that says "We always use representative data in our examples", or "literals are always bolded" or "variables which you are presumed to have already defined are always italicized".

For instance, in the example above, I would have presented it thusly for clarity:

contains(s) 
where s is a user-defined variable of type CharSequence 
Returns true if and only if this string contains the specified sequence of char values.

I've been unsuccessful in finding anything that documents the documentation, and most of my searches return results about JavaDoc. I'd love a link if someone knows about it.


Solution

  • CharSequence is an interface in java. Generally while going though the methods in javadocs if you see something that you don't understand try moving mouse over it. It will be having a help text to help you. For example, in the link that you have provided if you move the cursor on CharSequence it will tell you that it is an interface in java.

    your understanding of the doc will increase with your understanding of java.