-
Notifications
You must be signed in to change notification settings - Fork 0
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
1차 세미나 기본과제 #4
base: main
Are you sure you want to change the base?
1차 세미나 기본과제 #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자바를 이해도 있게 잘 다루신 것 같아요! 수고하셨습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인터페이스와 상속을 이해도 있게 잘 다루신 것 같아요!
public class Main { | ||
public static void main(String[] args) { | ||
Avante avante = new Avante("mid size", 15.2, 122.0, 19600000); | ||
Morning morning = new Morning("small size", 12.7, 35.0, 9000000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
size에 관한 부분을 Enum을 통해 정적으로 구현해보면 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
과제하시느라 고생하셨습니다 ~ !
LGTM ~ 😄👍
public void go() { | ||
System.out.println("아반떼 주행하다"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 메서드 이외에서 @Override
어노테이션을 생략한 이유가 있을까요~?
|
||
public class Ferrari implements SportsCar { | ||
private int maxSpeed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface가 상속이 된다는 것이 보여주기 위해서 SportsCar interface를 만든 것 같군요!! 좋습니다 ~!
다만 이렇게 되면 Freeari 와 Morning, Avante의 부모가 달라서 다형성 부분에서 조금 아쉽네요... 😢
public static void go(Car car) { | ||
car.go(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ferrari 도 해당 메서드를 쓰게 된다면 좋을 거 같네요 ~ !
구현 내용
기본 과제
interface
abstract class
class
main