일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- reactnative
- Filter
- 리액트네이티브아이콘
- Next.js
- react
- 이진탐색
- err_connection_refused
- TS
- set
- Spring
- 슬라이딩윈도우
- npm에러
- mainapplication.kt
- 상속
- async
- app:compiledebugkotlin
- generic
- materialicons
- javascript
- 배열중복요소제거
- interface
- app.post
- array
- map
- extends
- 안드로이드빌드에러
- reactnative error
- forwardref type
- 스크롤이벤트
- 타입스크립트
- Today
- Total
목록상속 (2)
rhanziy
상속, method overriding을 사용해 햄버거 만들기 package HamBurger; class HamBurger { public String name; public HamBurger() { this("햄버거"); } protected HamBurger(String name) { this.name = name; } public void cook() { System.out.println(this.name + "를 만듭니다."); System.out.println("빵 사이에 들어가는 재료는?"); System.out.println("> 양상추"); System.out.println("+ 패티"); System.out.println("+ 피클"); } } class CheeseBurger exte..
// 옛날방식 상속기능 const Student = function(name, age){ this.name = name, this.age = age } Student.prototype.sayHi = function(){ console.log(`안녕 나는 ${this.name}이야`); } let 학생1 = new Student('Kim', 20); 학생1.sayHi(); var arr = [1,2,3]; var arr2 = [3,6,8,3,2,5,7]; Array.prototype.remove3 = function(){ for(let i = 0; i < this.length; i++){ if(this[i] == 3){ this.splice(i,1); } } } arr.remove3(); arr2.remo..