search
HomeSoftware TutorialOffice SoftwareHow to read JAVA JDK help documentation

怎么看JAVA JDK的帮助文档

How to read JAVA JDK help documentation

To learn java, you must be able to use the help documentation. Here is a brief explanation of the help documentation.

Tools/Materials

JDK API 1.60

JDK 1.60

Steps/Method

Figure 1 shows HashSet as an example. ①: The inheritance relationship of the HashSet class; ②: Indicates the excuse for implementation; ③: Known subclasses; ④: The definition of this class in the source code can directly see who the class inherits and what excuse it needs to implement. ⑤: Class package in java;

In Figure 2. ① is the constructor of this class; ② is the return value of the method; find the corresponding method and click to enter the detailed description of the method

In the detailed method, it is written that the add method is inherited from the previous level and overridden. At this time, you can find the corresponding source code in the JDK to view. The source code is stored in the src compressed package in the JDK.

Find HashSet.java

under the java.util package

Find the add method source code after opening it

Watch the source code and see its implementation to help you learn java better

END

Precautions

If you want to view the source code, you need to install JDK. After installation, unzip the src file in the JDK directory!

How to use java API help documentation

API is just like a Chinese dictionary when learning Chinese characters. The basic classes you need to use when programming all exist in the API, and as time goes by, the number of these classes will increase.

Generally open the API, you can see three parts, upper left, lower left and right. The upper left part is all the packages, which is the largest part; then the lower left part is the specific content of the package you selected in the upper left part, generally including interfaces, classes, enumerations, exceptions, errors, etc. When you select a specific class in the lower left part, a specific explanation of the class will appear in the right part, followed by its construction methods, common methods, etc. Our main focus is on common methods.

When looking at the API, for example, if you want to find the String class, you first need to know where it is in the class, that is, which package it is in, and then you find the String class (in the java.lang package) through the connection. Then find the String class in the java.lang package, and then you can view the specific content of the String class. For example, when explaining String, it was said that String objects are immutable (this sounds a little more important than other nonsense), and then a general explanation of the methods of the String class was given. Next, you can look at the specific methods.

For example, if you want to compare a string, you need to use the equals(Object anObject) method. Its parameter is an object. The method explanation is: compare this string with the specified object.

Specific usage, such as String str = "a"; str.equals("b");

Because "a" is not equal to "b", this method returns false.

How to use jdk1 6 API help document

1: Open the help document

2: Click display, find the index, and see the input box

3: Know who you are looking for? Take Scanner as an example

4: Enter Scanner in the input box and press Enter

5: Look at the package

Classes under the java.lang package do not need to be imported, but all others need to be imported.

To import:

java.util.Scanner

6: Take a brief look at the explanation and description of the class, and don’t forget to look at the version of the class

7: Look at the structure of the class

Member variable field summary

Construction method Construction method summary

Member Method Method Summary

8: Learning construction methods

A: Create an object if there is a constructor

B: There is no constructor and the members may be static

9: Look at member methods

A: Left side

Whether it is static: If it is static, it can be called through the class name

Return value type: You can receive whatever others return.

B: Right

Look at the method name: Don’t write the method name incorrectly

Parameter list: Give people whatever they want; give them as many as they want

The above is the detailed content of How to read JAVA JDK help documentation. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Excel办公网. If there is any infringement, please contact admin@php.cn delete
Excel CONCATENATE function to combine strings, cells, columnsExcel CONCATENATE function to combine strings, cells, columnsApr 30, 2025 am 10:23 AM

This article explores various methods for combining text strings, numbers, and dates in Excel using the CONCATENATE function and the "&" operator. We'll cover formulas for joining individual cells, columns, and ranges, offering solutio

Merge and combine cells in Excel without losing dataMerge and combine cells in Excel without losing dataApr 30, 2025 am 09:43 AM

This tutorial explores various methods for efficiently merging cells in Excel, focusing on techniques to retain data when combining cells in Excel 365, 2021, 2019, 2016, 2013, 2010, and earlier versions. Often, Excel users need to consolidate two or

Excel: Compare two columns for matches and differencesExcel: Compare two columns for matches and differencesApr 30, 2025 am 09:22 AM

This tutorial explores various methods for comparing two or more columns in Excel to identify matches and differences. We'll cover row-by-row comparisons, comparing multiple columns for row matches, finding matches and differences across lists, high

Rounding in Excel: ROUND, ROUNDUP, ROUNDDOWN, FLOOR, CEILING functionsRounding in Excel: ROUND, ROUNDUP, ROUNDDOWN, FLOOR, CEILING functionsApr 30, 2025 am 09:18 AM

This tutorial explores Excel's rounding functions: ROUND, ROUNDUP, ROUNDDOWN, FLOOR, CEILING, MROUND, and others. It demonstrates how to round decimal numbers to integers or a specific number of decimal places, extract fractional parts, round to the

Consolidate in Excel: Merge multiple sheets into oneConsolidate in Excel: Merge multiple sheets into oneApr 29, 2025 am 10:04 AM

This tutorial explores various methods for combining Excel sheets, catering to different needs: consolidating data, merging sheets via data copying, or merging spreadsheets based on key columns. Many Excel users face the challenge of merging multipl

Calculate moving average in Excel: formulas and chartsCalculate moving average in Excel: formulas and chartsApr 29, 2025 am 09:47 AM

This tutorial shows you how to quickly calculate simple moving averages in Excel, using functions to determine moving averages over the last N days, weeks, months, or years, and how to add a moving average trendline to your charts. Previous articles

How to calculate average in Excel: formula examplesHow to calculate average in Excel: formula examplesApr 29, 2025 am 09:38 AM

This tutorial demonstrates various methods for calculating averages in Excel, including formula-based and formula-free approaches, with options for rounding results. Microsoft Excel offers several functions for averaging numerical data, and this gui

How to calculate weighted average in Excel (SUM and SUMPRODUCT formulas)How to calculate weighted average in Excel (SUM and SUMPRODUCT formulas)Apr 29, 2025 am 09:32 AM

This tutorial shows you two simple ways to calculate weighted averages in Excel: using the SUM or SUMPRODUCT function. Previous articles covered basic Excel averaging functions. But what if some values are more important than others, impacting the f

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment