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
- array
- 게시판 리뷰 만들기
- Spring
- Entity
- 클래스 상속
- 국비지원교육
- GIT
- Algorism study
- crud
- AWS
- Sts
- group study
- Interface
- 메가바이트스쿨
- MVC 패턴
- MVC
- spring boot
- 클래스 class
- tomcat
- 게시판 만들기
- github
- #javaStudy
- MegabyteSchool
- View
- #패스트캠퍼스 #국비지원교육 #메가바이트스쿨 #MegabyteSchool #개발자취업부트캠프 #내일배움카드
- 개발자취업부트캠프
- 패스트캠퍼스
- side project
- Java
- 내일배움카드
Archives
- Today
- Total
목록instanceof (1)
tuter77
Java : 다운 캐스팅, instanceOf
▷DownCasting - 업캐스팅 된 클래스를 다시 원래의 타입으로 형 변환 - 하위 클래스로의 형 변환은 명시적으로 해야한다. 예시) Customer vc = new VIPCustomer(); //묵시적 VIPCustomer vCustomer = (VIPCustomer)vc; //명시적 ▷ instanceof 키워드 해당 instance의 타입을 확인해 인스턴의 형이 맞으면 true, 아니면 false를 반환한다. 예시) Customer customerE = new GoldCustomer(10030, "Edward"); if(customerE instanceof GoldCustomer) { GoldCustomer vc = (GoldCustomer)customerE; System.out.println(..
JavaStudy
2023. 1. 29. 20:23