์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- ๋น์ผ๊ฐ์ฒด์์ฑ
- builder null
- ์๋ฐ์์
- ์ธ๋ฑ์คํ์ค์บ
- ์ดํํฐ๋ธ์๋ฐ
- mysql
- ์๋ฐ์์์ฐ๋ ๋๋ฅผ ์ฌ์ฉํ๋ ์ด์
- index full scan
- item15
- ์๋ฐ๋ผ์ด๋ธ์คํฐ๋
- Item6
- ์ธ๋ฑ์ค์คํต์ค์บ
- assert.notnull
- hikari cp ์ค์
- ์์
- ์๋ผ์คํฑ์์น๋ฉ์ธ์ง์ฉ๋
- ์ํฐ๋ ๋ณ์ข ๊ฐ๋ฐ์
- index skip scan
- enum ์์ฑ์ ์ ๊ทผ ์ ํ์
- ๋ฐ์ดํฐ๋ฒ ์ด์ค๊ฒฉ๋ฆฌ์์ค
- ๋ฐ์ฉ๋ ์ค๊ตญ์ด
- InnoDB์ํคํ ์ฒ
- SVN
- ์์ดํ 15
- ์๋ฐ์ฐ๋ ๋
- mysql์ํคํ ์ฒ
- ์ํฐ๋ ๊ฐ๋ฐ์ํ์ฌ
- effectiveJava
- ์๋ฐ
- Hikari Connection Pool
- Today
- Total
โ๐ป๊ธฐ๋กํ๋ ๋ธ๋ก๊ทธ
์์์์ ํด๋์ค ์์ฑ ๊ณผ์ ๊ณผ ํ ๋ณํ ๋ณธ๋ฌธ
ํ์ ํด๋์ค๊ฐ ์์ฑ๋๋ ๊ณผ์
ํ์ ํด๋์ค๊ฐ ์์ฑ๋ ๋ ์์ ํด๋์ค๊ฐ ๋จผ์ ์์ฑ๋จ
์์ ํด๋์ค์ ์์ฑ์๊ฐ ํธ์ถ๋๊ณ ํ์ ํด๋์ค์ ์์ฑ์๊ฐ ํธ์ถ๋จ
ํ์ ํด๋์ค์ ์์ฑ์์์๋ ๋ฌด์กฐ๊ฑด ์์ ํด๋์ค์ ์์ฑ์๊ฐ ํธ์ถ๋์ด์ผ ํจ
ํ์ ํด๋์ค์์ ์์ ํด๋์ค์ ์์ฑ์๋ฅผ ํธ์ถํ๋ ์ฝ๋๊ฐ ์๋ ๊ฒฝ์ฐ ์ปดํ์ผ๋ฌ๋ ์์ ํด๋์ค ๊ธฐ๋ณธ ์์ฑ์๋ฅผ ํธ์ถํ๊ธฐ ์ํ super()๋ฅผ ์ถ๊ฐํจ
super()๋ก ํธ์ถ๋๋ ์์ฑ์๋ ์์ ํด๋์ค์ ๊ธฐ๋ณธ ์์ฑ์
๋ง์ฝ ์์ ํด๋์ค์ ๊ธฐ๋ณธ ์์ฑ์๊ฐ ์๋ ๊ฒฝ์ฐ( ๋งค๊ฐ๋ณ์๊ฐ ์๋ ์์ฑ์๋ง ์กด์ฌํ๋ ๊ฒฝ์ฐ )
ํ์ ํด๋์ค๋ ๋ช ์์ ์ผ๋ก ์์ ํด๋์ค์ ์์ฑ์๋ฅผ ํธ์ถํด์ผ ํจ
์์์์ ๋ฉ๋ชจ๋ฆฌ ์ํ
์์ ํด๋์ค์ ์ธ์คํด์ค๊ฐ ๋จผ์ ์์ฑ๋๊ณ , ํ์ ํด๋์ค์ ์ธ์คํด์ค๊ฐ ์์ฑ๋จ
์์ ํด๋์ค๋ก์ ๋ฌต์์ ํ ๋ณํ ( ์ ์บ์คํ )
ํ์ ํด๋์ค๋ ๋ด๋ถ์ ์ผ๋ก ์์ ํด๋์ค์ ํ์ ์ ๋ดํฌํ๊ณ ์์ผ๋ฏ๋ก ์์ ํด๋์ค๋ก ๋ฌต์์ ํ ๋ณํ์ด ๊ฐ๋ฅ
์์ ํด๋์ค ํ์ผ๋ก ๋ณ์๋ฅผ ์ ์ธํ๊ณ ํ์ ํด๋์ค ์ธ์คํด์ค๋ฅผ ์์ฑํ ์ ์์
ํ์ง๋ง ๋ฐ๋๋ ์ฑ๋ฆฝ๋์ง ์์
1. ๋ถ๋ชจ ํด๋์ค
package inheritance;
public class Customer {
protected int customerID;
protected String customerName;
protected String customerGrade;
int bonusPoint;
double bonusRatio;
/* public Customer(){
customerGrade = "SILVER";
bonusRatio = 0.01;
System.out.println("Customer ์์ฑ์ ํธ์ถ");
}*/
public Customer(int customerID, String customerName) {
this.customerID = customerID;
this.customerName = customerName;
}
}
2. ๋ถ๋ชจ ํด๋์ค๋ฅผ ์์๋ฐ์ ์์ ํด๋์ค
package inheritance;
public class VIPCustomer extends Customer {
double salesRatio;
private int agentId;
/*public VIPCustomer(){
//super(); //์์ ํด๋์ค์ ๋ฉ๋ชจ๋ฆฌ ์์น๋ฅผ ๊ฐ๋ฅดํด super ์ ์ธ ์ ์์ ํด๋์ค์ ๊ธฐ๋ณธ ์์ฑ์๊ฐ ํธ์ถ๋จ , ํ๋ฆฌ์ปดํ์ผ ๋จ๊ณ์์ ๋ค์ด๊ฐ๊ฒ๋จ
customerGrade = "VIP";//์์๋ฐ์ customer ํด๋์ค์ ๋ณ์๊ฐ private( ์ธ๋ถ ํด๋์ค์์ ์ ๊ทผ ๋ถ๊ฐ ) customerGrade
//protected ๋ก ์ ์ธ๋ ๋ณ์๋ ๋ฉ์๋๋ ๋ค๋ฅธ ์ธ๋ถ ํด๋์ค์์๋ ์ฌ์ฉํ ์ ์์ง๋ง ํ์ ํด๋์ค์์๋ ์ฌ์ฉ ๊ฐ
bonusRatio = 0.05;
System.out.println("VIP Customer () ์์ฑ์ ํธ์ถ");
}*/
public VIPCustomer(int customerID, String customerName){
super(customerID, customerName);
customerGrade = "VIP";
bonusRatio = 0.05;
salesRatio = 0.1;
System.out.println("VIPCustomer (int , String) ์์ฑ์ ํธ์ถ ");
}
}
package inheritance;
public class CustomerTest {
public static void main(String[] args) {
VIPCustomer customerKim = new VIPCustomer(1020,"๊น์ ");
customerKim.
}
}
VIPCustomer() ์์ฑ์์ ํธ์ถ๋ก ์ธ์คํด์ค๋ ๋ชจ๋ ์์ฑ๋์์ง๋ง ์ฐธ์กฐ ๋ณ์์ ํ์ ์ด Customer์ด๋ฏ๋ก ์ ๊ทผํ ์ ์๋ ๋ฉ์๋๋ ๋ณ์๋ Customerํด๋์ค์ ๋ณ์์ ๋ฉ์๋๋ง ๊ฐ๋ฅ
package inheritance;
public class CustomerTest {
public static void main(String[] args) {
Customer customerKim = new VIPCustomer(1020,"๊น์ ");
customerKim.
}
}
'Language > Java' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ JAVA ] ๊ธฐ๋ณธํด๋์ค ( Object, String, Wrapper) (0) | 2020.12.13 |
---|---|
[ JAVA ] ๋คํ์ฑ polymorphism (0) | 2020.12.06 |
[JAVA] ์์ธ์ฒ๋ฆฌ (0) | 2020.11.22 |
[ JAVA ] ์์ (0) | 2020.11.15 |
[ JAVA ] static ์์ฉ - singleton pattern (0) | 2020.11.01 |