Skip to content

안녕하세요! 인터페이스 상속 관련 질문 있습니다. #2

@sujeongHeo

Description

@sujeongHeo

안녕하세요!

다름이 아니라
https://github.com/easyspubjava/FastCampus/blob/master/Chapter3/src/ch15/BookShelf.java
Chapter3/src/ch15/BookShelf.java 코드 실행 에러 관련 질문이 있습니다.

다름이 아니라 모든 메서드에 대해서 @Override 를 지워야 만 실행이 되어요

package ch15;

public class BookShelf extends Shelf implements Queue{

	//@Override
	public void enQueue(String title) {
		shelf.add(title);
	}

	//@Override
	public String deQueue() {
		return shelf.remove(0);
	}

	//@Override
	public int getSize() {
		return getCount();
	}

}

Shelf 클래스에서 enQueue, deQueue, getSize를 implement 를 안해서 에러가 뜨는 것 같아요..

그런데 교안이나 온라인 강의에서는 @override 가 있어도 동작을 해서, 조금 의아해서 질문드립니다.

감사합니다!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions