-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e57742a
commit 2134a85
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
## Super | ||
|
||
- [Calling a superclass constructor](#calling-a-superclass-constructor) | ||
- [Accessing method and variable of superclass](#accessing-method-and-variable-of-superclass) | ||
|
||
### Calling a superclass constructor | ||
- can call a constructor in the superclass of the current class | ||
- often used in constructor chaining, where there are multiple constructors in a class that call each other using this(), and the final constructor calls a constructor in the superclass using super() | ||
|
||
 | ||
|
||
### Accessing method and variable of superclass | ||
- can access methods or variables in the superclass of the current class | ||
- useful when there is a method or variable with the same name in both the superclass and subclass and the one in the superclass should be referred to | ||
|
||
 | ||
|