인터페이스 vs 추상클래스

1️⃣  추상클래스

// abstract 키워드를 붙여주어야 합니다.
abstract class 클래스이름 {

}

추상메서드

abstract class AbstractA {
	abstract void method();
}

추상클래스 규칙

public abstract class Player {
		boolean pause;
		int currentPos;

		public Player() {
			this.pause = false;
			this.currentPost = 0;
		}

		abstract void play(int pos);
		abstract void stop();

		void pause() {
			if(pause) {
					pause = false;
					play(currentPos);
			} else {
					pause = true;
					stop()
			}
		}
}

// 구현체
// 상속받은 메서드 외에 필드나 메서드 추가로 작성이 가능하다.
public class Melon extends Player {

	@Override
	void play(int pos) {
			// 구현
	}

	@Override
	void stop() {
			// 구현
	}

}

2️⃣ 인터페이스