OneCoder其实没有资格高谈阔论,只能说说个人的习惯和方式。自学和自我解决问题确实是一项非常非常重要的能力,远比你现在所会的知识重要的多的多,因为,你未知的永远的无穷的。

  关于API文档

  经常有朋友求各种API文档,初学者里常见的是要JDK的API文档。这个 OneCoder个人的习惯是,从来不会去下API文档,那个查找起来也不方便而且也没有代码辅助,而是直接去JDK的源码中看注释,甚至是源码。既方便,又直接,又精确,还接近本质。你下的JDK里,其实都带有源码的,而且默认还是绑定好的。这么方便,为何不看?

  比如,你用到了String类中的subString方法,想知道如何使用。你可以去看所谓的API文档,你也可以直接在你的IDE中点开String类,用ctrl+o搜索到subString方法。你可以看到他的注释:

    /**
         * Returns a new string that is a substring of this string. The
         * substring begins at the specified <code>beginIndex</code> and
         * extends to the character at index <code>endIndex - 1</code>.
         * Thus the length of the substring is <code>endIndex-beginIndex</code>.
         * <p>
         * Examples:
         * <blockquote><pre>
         * "hamburger".substring(4, 8) returns "urge"
         * "smiles".substring(1, 5) returns "mile"
         * </pre></blockquote>
         *
         * @param      beginIndex   the beginning index, inclusive.
         * @param      endIndex     the ending index, exclusive.
         * @return     the specified substring.
         * @exception  IndexOutOfBoundsException  if the
         *             <code>beginIndex</code> is negative, or
         *             <code>endIndex</code> is larger than the length of
         *             this <code>String</code> object, or
         *             <code>beginIndex</code> is larger than
         *             <code>endIndex</code>.
         */

  如果你了解,你会知道,所有的接口的API都是根据这个Javadoc生成的。顺便,你还可以看到它的实现,加深你的理解,何乐而不为呢?

  关于搜索引擎的使用

  解决问题好的办法,当然是去网上搜索。这里 OneCoder 必须要说的是,对于开发人员来说,百度确实不是一个好的搜索引擎,搜索出来的东西相关性和有效性都十分有限。这里, OneCoder 必须大力的推荐Google。真的不在一个层次上。你可能会说,Google总是被墙。这个, OneCoder 采用了不太通用的做法,那是常年购买了一个ssh的代理,专门用于访问google。呵呵:)其实,解决google问题的方法网上还有很多,你也可以去搜索一下。我们可以简单对比一下两个搜索引擎的搜索效果。

  以“Netty 教程”这个搜索词为例: