일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- setTimeout()
- 동기
- promise
- async
- 비동기
- eport
- slow and steady
- 게임
- Porject
- addEventListener
- json
- 참고블로그
- https://m.blog.naver.com/tt2t2am1118/221010125300
- await
- prj
- js
- db
- webpack
- JS #프로젝트
- https://youtube.com/playlist?list=PLuHgQVnccGMA5836CvWfieEQy0T0ov6Jh&si=FTaYv8m21EhO-A2K
- ajax
- Import
- mysql
- Project
- callback
- object
- database
- sql
- 혼프
- execCommand
- Today
- Total
목록📕JAVA/in28Minues (3)
C-log

package Section8_14; public class MotorBike { private int speed; MotorBike(int speed) { this.speed = speed; } } 가장 기본적인 개념이다. 생성자는 객체를 초기화하는 특별한 메서드이며 객체 지향 프로그래밍에서 객체는 클래스의 인스턴스로, 클래스를 기반으로 메모리에 할당된다. 이때 객체가 생성될 때 자동으로 호출되는 메서드가 생성자다.

package Section8_12; public class MotorBike { private int speed; public int sPeed; void setSpeed(int speed) { if (speed > 0) this.speed = speed; //System.out.println(speed); //System.out.println(this.speed); } int getSpeed() { return this.speed; } public int increaseSpeed(int howMuch) { setSpeed(this.speed + howMuch); return this.speed; } public int decreaseSpeed(int howMuch) { setSpeed(this.spe..

캡슐화 setter : private을 유지하는 setter MotorBike.java package Section8_07; public class MotorBike { private int speed; public int sPeed; void setSpeed(int speed) { this.speed = speed; //System.out.println(speed); //System.out.println(this.speed); } public void start() { System.out.println("Bike Started!!"); } } MotorBikeRunner.java package Section8_07; public class MotorBikeRunner { public static voi..