Java beginners learn how to solve problems by themselves

Source: Internet
Author: User

Today, a friend from the group (Java Coder group: 91513074) asked me how to read the help documentation or solve the problem. I hope I can introduce my methods.
In fact, this OneCoder is not qualified to talk about it. You can only talk about your habits and methods. Self-learning and self-solving are indeed a very important capability, far more important than the knowledge you have now, because you are always unknown.
About API documentation
Some people often ask for various API documents. The most common for beginners is jdk api documentation. This OneCoder's personal habit is that it never goes to the API documentation. It is not convenient to find it and there is no code assistance. Instead, it goes directly to the JDK source code to see comments, or even the source code. It is convenient, direct, accurate, and close to the essence. The JDK contains the source code and is bound by default. So convenient, why not?
For example, if you use the subString method in the String class, you want to know how to use it. You can go to the so-called API documentation. You can also open the String class in your IDE and use ctrl + o to search for the subString method. You can see his comment:
 
/**
* Returns a new string that is a substring of this string.
* 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
* <Code> beginIndex </code> is negative, or
* <Code> endIndex </code> is larger than the length
* This <code> String </code> object, or
* <Code> beginIndex </code> is larger
* <Code> endIndex </code>.
*/

If you understand it, you will know that the APIs of all interfaces are generated based on this Javadoc. By the way, you can also see its implementation and deepen your understanding. Why not?
 
Use of search engines
The best way to solve the problem is to search online. What OneCoder must say here is that for developers, Baidu is indeed not a good search engine, and the relevance and effectiveness of searched items are very limited. Here, OneCoder must strongly recommend Google. It is really not at the same level. You may say that Google is always on the wall. In this case, OneCoder adopts an uncommon practice, that is, purchasing an ssh proxy dedicated to accessing google all the year round. Haha :) actually, there are still many ways to solve google problems online. You can also search for them. We can briefly compare the search results of the two search engines.
 
Take the search term "Netty tutorial" as an example:
 
 
For the same OneCoder Original Articles, Baidu's top posts are indeed reprinted articles maliciously collected by the collection site, rather than original articles. This has a great impact on obtaining the original accurate information.
 
As for the comparison of relevance and information cutting-edge, OneCoder cannot find a suitable example at the moment and does not make a legend for the moment. However, as you use them slowly, you will gradually discover the differences between the two. For example, when you search for cutting-edge topics or rare errors. Google often provides valuable reference information.
Self-solving problems
This is actually abstract. You may say that this is often accumulated. Yes, this really requires experience, but how can we accumulate the 1.1 drops of experience? Do you rely on asking others?
 
Since we have mentioned the search engine, we will use it. Good keywords allow me to get closer to the answer faster. Here, OneCoder's ignorance is: Do not use some examples: What should I do? Why? Input keywords. Especially when an exception occurs, you can directly paste the exception information to the search engine for search. (Note: remove the information related to your own code, as long as it is common .)
For example, today OneCoder encounters a null pointer problem caused by a Hibernate exception. Without a clue at the moment, I pasted all the abnormal information and some stacks into google, and found valuable information on stackoverflow, thus solving the problem.
About StackOverFlow
A well-known Q & A community outside China, with all kinds of questions, and extremely earnest and friendly answers. OneCoder has solved the problem above. Of course, I did not ask questions directly, but Google gave me the answer. Thanks to Google.
About Other
In fact, the tool used by OneCoder is that simple. Source code + Google. In addition, a brain that is good at summing up and thinking is more essential. This is the so-called accumulation of experience and knowledge.
 
Solving a problem is not the key. The key is to solve a type of problem. More importantly, it is to solve problems that have never been encountered independently. This is a very important capability. I would rather find a zero-based person who can learn and solve the problem by myself. I do not need a person who has the foundation but is also limited to this person. Personal meeting, for reference only.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.