day18_FlyingCar1

육희영·2021년 10월 28일
0
package com.java1.day18;

interface Drivable {
	void drive();
}

interface Flyable {
	void fly();
}

public class FlyingCar1 implements Drivable, Flyable { //inteface 다중 상속

	public void drive() {
		System.out.println("I'm driving");

	}

	public void fly() {
		System.out.println("I'm flying");

	}

	public static void main(String[] args) {
		FlyingCar1 obj = new FlyingCar1();
		obj.drive();
		obj.fly();
	}
}

출력결과

I'm driving
I'm flying

0개의 댓글

Powered by GraphCDN, the GraphQL CDN