Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

1차 세미나 기본과제 #4

wants to merge 2 commits into from

Conversation

05AM
Copy link
Member

@05AM 05AM commented Apr 14, 2023

구현 내용

기본 과제

interface

  • Car
  • SportsCar : interface Car 상속

abstract class

  • Car

class

  • Avante : abstract class Car 상속
  • Morning : abstract class Car 상속
  • Ferrari : interface SportsCar 구현
  • Box : general 구현

main

  • 메소드 printArray : general method 구현

Copy link
Member

@PgmJun PgmJun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

자바를 이해도 있게 잘 다루신 것 같아요! 수고하셨습니다!

Seminar 1/JavaOOPExample/src/Class/Box.java Show resolved Hide resolved
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size에 관한 부분을 Enum을 통해 정적으로 구현해보면 어떨까요?

Copy link

@KWY0218 KWY0218 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

과제하시느라 고생하셨습니다 ~ !
LGTM ~ 😄👍

Comment on lines +13 to +15
public void go() {
System.out.println("아반떼 주행하다");
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 메서드 이외에서 @Override 어노테이션을 생략한 이유가 있을까요~?

Comment on lines +4 to +6

public class Ferrari implements SportsCar {
private int maxSpeed;
Copy link

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의 부모가 달라서 다형성 부분에서 조금 아쉽네요... 😢

Comment on lines +26 to +28
public static void go(Car car) {
car.go();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ferrari 도 해당 메서드를 쓰게 된다면 좋을 거 같네요 ~ !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants