Skip to content

Commit

Permalink
Merge pull request astaxie#795 from ZhenhangTung/master
Browse files Browse the repository at this point in the history
fix interface implementation of student and employee
  • Loading branch information
astaxie authored Feb 27, 2017
2 parents 3fcf783 + bf4ef1e commit 0e2322f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion en/02.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Let's do some more work. We'll add one more method `Sing()` to them, along with

Now, Student has three methods called `SayHi()`, `Sing()` and `BorrowMoney()`, and Employee has `SayHi()`, `Sing()` and `SpendSalary()`.

This combination of methods is called an interface and is implemented by both Student and Employee. So, Student and Employee implement the interface: `SayHi()` and `Sing()`. At the same time, Employee doesn't implement the interface: `SayHi()`, `Sing()`, `BorrowMoney()`, and Student doesn't implement the interface: `SayHi()`, `Sing()`, `SpendSalary()`. This is because Employee doesn't have the method `BorrowMoney()` and Student doesn't have the method `SpendSalary()`.
This combination of methods is called an interface and is implemented by both Student and Employee. So, Student and Employee implement the interface: `SayHi()` and `Sing()`. At the same time, Employee doesn't implement the interface: `BorrowMoney()`, and Student doesn't implement the interface: `SpendSalary()`. This is because Employee doesn't have the method `BorrowMoney()` and Student doesn't have the method `SpendSalary()`.

### Type of Interface

Expand Down

0 comments on commit 0e2322f

Please sign in to comment.