Skip to content

Update CH09.md #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/CH09.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### 9.1.1 成員內部類別、區域內部類別

使用內部類別有幾個好處,其一是內部類別可以直接存取其所在類別中的私用(private)成員;其二是當某個 Slav e類別完全只服務於一個 Master 類別時,您可以將之設定為內部類別,如此使用 Master 類別的人就不用知道 Slave 的存在;再者是像在「靜態工廠」(Static factory)模式中,對呼叫靜態方法的物件隱藏返回物件的實作細節或產生方式。
使用內部類別有幾個好處,其一是內部類別可以直接存取其所在類別中的私用(private)成員;其二是當某個 Slave類別完全只服務於一個 Master 類別時,您可以將之設定為內部類別,如此使用 Master 類別的人就不用知道 Slave 的存在;再者是像在「靜態工廠」(Static factory)模式中,對呼叫靜態方法的物件隱藏返回物件的實作細節或產生方式。

先來介紹成員內部類別,基本上是在一個類別中直接宣告另一個類別,例如:

Expand Down