简体   繁体   English

搜索javadoc时如何获取最新的搜索结果

[英]How to get up-to-date search results when searching for javadoc

Recently I've observed a lot of people still giving links to javadocs of 1.4.2. 最近,我观察到许多人仍在提供指向1.4.2的javadocs的链接。 This is not quite a good practice and I'd like to raise the question. 这不是一个很好的做法,我想提一个问题。

This happens because search engines (Google at least) give the old javadoc if one searches for, let's say, java.lang.String 发生这种情况是因为,如果有人搜索java.lang.String ,那么搜索引擎(至少是Google)会给出旧的Javadoc。

So, how to get the javadoc for the correct (currently 1.6) version of JDK? 那么,如何获取正确(当前为1.6)JDK版本的javadoc?

In almost all cases, adding the version after the searched class gets the desired result on top. 在几乎所有情况下,在搜索到的类之后添加版本都会在顶部获得所需的结果。 For example: 例如:

  • "java.lang.String 6" “ java.lang.String 6”
  • "java.util.Collection 5" “ java.util.Collection 5”

(note - it's not "1.6" - only "6") (请注意-不是“ 1.6”,只有“ 6”)

As they are updated, the tutorials are already referencing draft version of the Java 7 API. 在更新时,这些教程已经在引用Java 7 API的草稿版本。 For example How to Use Tables refers to JTable . 例如, 如何使用表是指JTable

I prefer to download and install the javadoc when I'm installing a new Java version. 在安装新的Java版本时,我更喜欢下载并安装javadoc。
So I always have the correct javadoc on the disk. 所以我总是在磁盘上有正确的javadoc。 Uses some disk space but it's faster and allows working offline. 使用一些磁盘空间,但速度更快,并且可以脱机工作。

Drawback: you can not copy&paste the links in a forum 缺点:您不能复制并粘贴论坛中的链接

I've always been surprised that nobody at Google updates documentation searches to default to the latest versions. 我一直感到惊讶的是,Google更新文档中没有人搜索默认的最新版本。

I usually just add "Java 6" if I am searching for "Java 6" and "Galileo" if I am searching for Eclipse stuff (as I usually get the Eclipse 3.2 docs with a default search). 如果要搜索“ Java 6”,通常只添加“ Java 6”,如果要搜索Eclipse,则通常添加“ Galileo”(因为我通常会使用默认搜索来获取Eclipse 3.2文档)。 Adding JavaDoc for good measure helps with the more obscure classes in general. 一般情况下,添加JavaDoc可以很好地帮助处理更晦涩的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM