Skip to content

Update CH07.md #24

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
Jan 24, 2018
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/CH07.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public class SafeArrayDemo {

public Account(String number, double money) {
accountNumber = number; // 實際等於this.accountNumber = number;
this.balance = money; // 實際等於this.balance = money;
balance = money; // 實際等於this.balance = money;
}

this 除了用來參考至呼叫方法的實際物件之外,還有一種可以帶引數的用法,主要是用於呼叫建構方法,而避免直接以建構方法的名稱來呼叫,例如在下面的程式片段中,當使用無參數的建構方法 Ball() 時,它會呼叫有參數的建構方法:
Expand Down