inheritance & interface of java
TRANSCRIPT
Inheritance & Interface of Java
창원대학교 정보통신공학과 Mobile-X 유지용
지도교수 : 박동규 2015.12.01.
Inheritance
Inheritance
기존의 클래스를 재사용하여 새로운 클래스를 작성
코드의 양이 적어져 효율적
코드를 공통적으로 관리하여 유지보수가 용이
조상 클래스 - parent·super·base class 자손 클래스 - child·sub·derived class
Inheritance
Inheritance
super
sub sub
super
InheritanceObject
Human
Organism
Mammal
Inheritance
Inheritance
Elf클래스에서 선언하지 않았어도 Human클래스에서 선언
하였기에 사용가능
Inheritance
Inheritance
Inheritance
Inheritance
Inheritance
Inheritance
Inheritance
abstract void method (String name);
추상메서드를 구현 메소드의 리턴타입, 이름, 변수선언 세미콜론사용
Inheritance
Inheritance
Interface
추상메서드와 상수만으로 구성
모든 멤버변수는 public final static 이어야 하며, 이는 생략가능
모든 메서드는 public abstract 이어야 하며, 이는 생략가능
인터페이스는 다중상속이 가능
조상클래스가 다른 클래스들의 연결이 가능해진다
Interface
Interface
Reference Type of Java
제작지원