-
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
Showing
2 changed files
with
9 additions
and
9 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
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,7 +1,16 @@ | ||
package extends1.ex3; | ||
|
||
public class ElectricCar extends Car { | ||
|
||
// Override 애노테이션은 생략해도 되지만, 어떤 표시임 | ||
// method가 override를 하지 않았다면 컴파일 오류를 내준다! | ||
// 개발자 입장에서는 실수하지 않을 수 있는 제약을 만들어줌 | ||
@Override | ||
public void move() { | ||
System.out.println("전기차를 빠르게 이동합니다."); | ||
} | ||
public void charge() { | ||
|
||
System.out.println("충전합니다."); | ||
} | ||
} |