반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- spring MVC
- 401오류
- abap value in field Data Class error
- @Controller
- jpa
- 세션vs쿠키
- n+1
- Testcode
- 필터의 정의
- java.lang.AssertionError
- optional
- 유연한 컨트롤러1 - v5
- 김영한
- BindingResult
- 쿠키의 정의
- 구글 보안 api 활용
- SpringMVC
- controller
- spring
- 쿠키란
- filter vs interceptor
- springSecurityFilterChain 오류
- application-properties
- 세션의 정의
- MVC
- 세션이란
- 필터vs인터셉터
- .orelseThrow
- Validation
- 인터셉터의 정의
Archives
- Today
- Total
ABAP DUMP ERROR 24시
extends , interface 언제 써야 할까? 본문
반응형
결론
Class 가 Class를 상속 : extends
Class 가 interface를 상속 : implements
Interface 가 Class를 상속 : extends
Interface 가 interface를 상속 : extends
Java에는 다중 상속이 지원이 되지 않는다.
따라서, 일반 상속(1개 상속)시 에는 extends를 사용한다.
그러나 다중 상속을 지원할수 있는 방법이 존재!
implements의 사용이다.
extends는 1개의 클래스만 상속 받을수 있고, 자식 클래스는 부모 클래스들의 기능들을 사용이 가능하다!.
implements는 여러개의 interface들을 상속 받을 수 있지만 부모 기능들을 모두다 @Override해서 사용해야한다!
반응형
'[WEB]Back-end > Java' 카테고리의 다른 글
ArrayList vs HashMap ,HashMap vs HashTable, 제네릭이란? (0) | 2022.02.10 |
---|---|
static, final, 필드, 메소드, 인스턴스 의미 정리 (0) | 2022.01.26 |
java 에서 this가 뭐야? (0) | 2022.01.20 |
int 와 Integer의 차이점 (0) | 2022.01.16 |
Abstract 과 interface 비교 (0) | 2022.01.10 |
Comments