๊ด€๋ฆฌ ๋ฉ”๋‰ด

๋ชฉ๋ก์ „์ฒด ๊ธ€ (39)

โœ๐Ÿป๊ธฐ๋กํ•˜๋Š” ๋ธ”๋กœ๊ทธ

ํ•ด์‹œ - Lv1.์™„์ฃผํ•˜์ง€ ๋ชปํ•œ ์„ ์ˆ˜

HashTable์ด๋ž€ F(key) → HashCode → Index → Value ๊ฒ€์ƒ‰ํ•˜๊ณ ์ž ํ•˜๋Š” ํ‚ค๊ฐ’์„ ํ•ด์‰ฌ ํ•จ์ˆ˜์— ์ž…๋ ฅ ํ›„ ๋ฐ˜ํ™˜๋ฐ›์€ ํ•ด์‰ฌ ์ฝ”๋“œ๋ฅผ ๋ฐฐ์—ด์˜ ์ธ๋ฑ์Šค๋กœ ํ™˜์‚ฐํ•˜์—ฌ ๋ฐ์ดํ„ฐ์— ์ ‘๊ทผํ•˜๋Š” ๋ฐฉ์‹์˜ ์ž๋ฃŒ๊ตฌ์กฐ ํ•ด์‰ฌ ํ•จ์ˆ˜๋Š” ํŠน์ •ํ•œ ๊ทœ์น™์„ ์ด์šฉํ•ด์„œ ์ž…๋ ฅ๋ฐ›์€ ํ‚ค๊ฐ’์ด ์–ผ๋งˆ๋‚˜ ํฐ์ง€ ์ƒ๊ด€์—†์ง€ ๋™์ผํ•œ ํ•ด์‰ฌ ์ฝ”๋“œ๋ฅผ ๋งŒ๋“ค์–ด์คŒ ๋ฐ์ดํ„ฐ ์–‘์ด ๋งŽ์„๋–„ ์ง์ ‘ ๋ฐ์ดํ„ฐ๋ฅผ ๋น„๊ตํ•˜๊ธฐ ํž˜๋“ค๊ณ , ๊ณต๋ฐฑ ํ•˜๋‚˜๋งŒ ํ‹€๋ ค๋„ ์ „ํ˜€ ๋‹ค๋ฅธ ํ•ด์‰ฌ ์ฝ”๋“œ๊ฐ’์„ ๋งŒ๋“ค์–ด๋ƒ„ ํ•ด์‰ฌ ํ•จ์ˆ˜๋Š” ๋น ๋ฅด๋‹ค๋Š” ์žฅ์ ์„ ๊ฐ€์ง //[mislav, stanko, mislav, ana] for(String pmem : participant){ comMap.put(pmem,"fail"); } -> ๋น ๋ฅธ ์ด์œ  : ๋ฐฐ์—ด ๊ณต๊ฐ„์„ ๊ณ ์ •๋œ ํฌ๊ธฐ๋งŒํผ ๋ฏธ๋ฆฌ ๋งŒ๋“ค์–ด๋†“๊ณ  ํ•ด์‰ฌ ์ฝ”๋“œ๋ฅผ ๋ฐฐ์—ด์˜ ๊ฐœ์ˆ˜๋กœ ๋‚˜๋จธ์ง€ ์—ฐ..

[ SVN ] commit & tag์ƒ์„ฑ

2. ์ถ”๊ฐ€๋œ ํŒŒ์ผ commit ํ•˜๊ธฐ ๋กœ์ปฌ project09 ํ”„๋กœ์ ํŠธ์— hellome๋ผ๋Š” ์ œ๋ชฉ์˜ ํด๋ž˜์Šค๋ฅผ ์ถ”๊ฐ€ํ–ˆ๋‹ค. ์›๊ฒฉ svn repository์—๋Š” hellome์ž๋ฐ” ํŒŒ์ผ์ด ์—†์Œ์ด ํ™•์ธ๋œ๋‹ค. ์•„์ง ์›๊ฒฉ ์„œ๋ฒ„์—๋Š” ์˜ฌ๋ฆฌ์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ ๋กœ์ปฌ์— ์žˆ๋Š” project09๋ฅผ ์›๊ฒฉ svn repository์— commit ํ•˜์ž ํ•ด๋‹น ํŒŒ์ผ ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ team> commit ํ•ด๋‹น ํŒŒ์ผ๋งŒ ์›๊ฒฉ ์„œ๋ฒ„์— ์˜ฌ๋ฆฌ๊ณ  ์‹ถ์œผ๋ฏ€๋กœ ํ•ด๋‹น ํŒŒ์ผ์—์„œ๋งŒ commit๋ช…๋ น์„ ์ˆ˜ํ–‰ํ•œ๋‹ค. commit ๋ฉ”์‹œ์ง€๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ์•„๋ž˜์— svn repository์— hellome์ž๋ฐ” ํŒŒ์ผ์ด ์˜ฌ๋ผ๊ฐ„ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. 3. ํ˜„์žฌ๊นŒ์ง€์˜ ๋ฒ„์ „ tag๋กœ ๋งŒ๋“ค๊ธฐ ์ง€๊ธˆ ๊นŒ์ง€ ์ž‘์—…ํ•œ ํŒŒ์ผ์„ ๋ฒ„์ „ 1.0์œผ๋กœ ๋งŒ๋“ค๊ณ  ๋‹ค์Œ ๋ฒ„์ „ 1.1์„ ์ž‘์—…ํ•˜๊ธฐ ์œ„ํ•ด ํ˜„์žฌ ๋ฒ„์ „์„ tag๋กœ ..

ํ˜•์ƒ๊ด€๋ฆฌ 2020. 9. 20. 16:02
[ SVN ] SVN ์šฉ์–ด ๋ฐ ์ƒ์„ฑํ•œ ํ”„๋กœ์ ํŠธ svn repository์˜ฌ๋ฆฌ๊ธฐ

ํšŒ์‚ฌ์—์„œ๋Š” ๋ฒ„์ „๊ด€๋ฆฌ๋กœ svn์„ ์‚ฌ์šฉํ•˜๊ณ ์žˆ์—ˆ๋‹ค. ์ฒ˜์Œ ์‚ฌ์šฉํ•ด๋ณด๋ฉด์„œ ๊ธฐ๋ณธ์ ์ธ ์‚ฌ์šฉ๋ฒ•์„ ์ •๋ฆฌํ–ˆ๋‹ค. 1. svn์šฉ์–ด 2. svn ์‹ค์Šต 2.1. ๋กœ์ปฌ์—์„œ ์ƒ์„ฑํ•œ ํ”„๋กœ์ ํŠธ svn repository์˜ฌ๋ฆฌ๊ธฐ 2.2. ์ถ”๊ฐ€๋œ ํŒŒ์ผ commitํ•˜๊ธฐ 2.3. ํ˜„์žฌ๊นŒ์ง€์˜ ๋ฒ„์ „ tag๋กœ ๋งŒ๋“ค๊ธฐ SVN ์šฉ์–ด trunk ํ˜„์žฌ ๊ฐœ๋ฐœ๋˜์–ด์žˆ๋Š” ๊ฐ€์žฅ ์ค‘์‹ฌ ์ค„๊ธฐ branch trunkํ”„๋กœ์ ํŠธ ๊ธฐ์ค€์œผ๋กœ ๊ตฌํ˜„๋œ ๊ธฐ๋Šฅ์„ ๋ณ€๊ฒฝ ์‹œ , trunk์—์„œ branch๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ๋ณต์‚ฌ ํ›„ ์—…๋ฐ์ดํŠธ ๋ฒ„์ „์˜ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค. ์ž‘์—…์„ ์™„๋ฃŒ ํ›„ trunk๋กœ merge ํ•˜๋Š” ๊ฒฝ์šฐ๋„ ์žˆ์ง€๋งŒ ํ˜„ ์—…๋ฌด์—์„œ๋Š” branch๊ฐ€ ์ˆ˜์ฃผํ•œ ํ”„๋กœ์ ํŠธ๋ณ„ ๋ฒ„์ „์„ ๋œปํ•˜๋ฏ€๋กœ trunk์— mergeํ•˜์ง€ ์•Š๊ณ  ๋…๋ฆฝ์ ์ธ ํ”„๋กœ์ ํŠธ ๋ฒ„์ „์„ ์œ ์ง€ํ•จ. tag ๋ณดํ†ต ์Šค๋ƒ…์ƒท์„ ์ฐ์„ ๋•Œ ์ด์šฉ ๋ฆด๋ฆฌ์ฆˆ ..

ํ˜•์ƒ๊ด€๋ฆฌ 2020. 9. 13. 21:21
[ JAVA ] ์ •๋ณด์€๋‹‰ - ์ ‘๊ทผ ์ œํ•œ์ž

์ ‘๊ทผ ์ œํ•œ์ž public ์–ด๋””์„œ๋‚˜ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅ private ํด๋ž˜์Šค ๋‚ด๋ถ€์—์„œ๋งŒ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅ, ํด๋ž˜์Šค ์™ธ๋ถ€์—์„œ ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€ํ•จ private ํ•œ ๋ณ€์ˆ˜์— ์ ‘๊ทผํ•˜๊ธฐ ์œ„ํ•ด public ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•จ ( get, set)ํด๋ž˜์Šค ๋‚ด๋ถ€ ๋ฐ์ดํ„ฐ๋ฅผ ์ž˜๋ชป ์‚ฌ์šฉํ•˜๋Š” ์˜ค๋ฅ˜๋ฅผ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค. protected ๊ฐ™์€ ํŒจํ‚ค์ง€ ๋‚ด๋ถ€์—์„œ ์ ‘๊ทผ ๊ฐ€๋Šฅ. ์ƒ์† ์‹œ ์ƒ์œ„ ํด๋ž˜์Šค์˜ private ๋ณ€์ˆ˜๋‚˜ ๋ฉ”์„œ๋“œ๋ฅผ ์ƒ์†๋ฐ›์€ ํ•˜์œ„ ํด๋ž˜์Šค๊ฐ€ public ๋ณ€์ˆ˜์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•˜๋„๋ก ํ•  ๋•Œ protected๋กœ ๋ณ€์ˆ˜๋ฅผ ์„ ์–ธ ์•„๋ฌด๊ฒƒ๋„ ์•ˆ ์“ฐ๋Š” ๊ฒฝ์šฐ ( default ๊ธฐ๋ณธ ์ ‘๊ทผ ์ œ์–ด์ž) ๊ฐ™์€ ํŒจํ‚ค์ง€ ๋‚ด์—์„œ๋งŒ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅ, ์„œ๋กœ ๋‹ค๋ฅธ ํŒจํ‚ค์ง€์—์„œ๋Š” ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€

Language/Java 2020. 9. 10. 21:30
[ JAVA ] ์ƒ์„ฑ์ž์™€ ์ƒ์„ฑ์ž ์˜ค๋ฒ„๋กœ๋”ฉ

์ƒ์„ฑ์ž๋ž€? ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•  ๋•Œ new ํ‚ค์›Œ๋“œ์™€ ํ•จ๊ป˜ ํ˜ธ์ถœ, ๊ฐ์ฒด ์ƒ์„ฑ ์ด์™ธ์—๋Š” ํ˜ธ์ถœํ•  ์ˆ˜ ์—†์Œ ๋ฐ˜ํ™˜ ๊ฐ’์ด ์—†์Œ, ์ƒ์†๋˜์ง€ ์•Š์Œ ์ƒ์„ฑ์ž๋Š” ํด๋ž˜์Šค์˜ ์ด๋ฆ„๊ณผ ๋™์ผ ์ธ์Šคํ„ด์Šค๋ฅผ ์ดˆ๊ธฐํ™”ํ•˜๋Š” ์—ญํ• ์€ ํ•จ ( ๋ฉค๋ฒ„ ๋ณ€์ˆ˜ ์ดˆ๊ธฐํ™” ) -> ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ• ๋•Œ๋งˆ๋‹ค ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ๊ฐ’์œผ๋กœ ์ดˆ๊ธฐํ™”ํ•˜๊ณ  ์‹ถ์„ ๋•Œ๋ผ๊ณ  ์ƒ๊ฐํ•˜์ž, ์ด ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค ๋•Œ๋Š” ์ด ๊ฐ’๋“ค์„ ๋ฐ›์•„์„œ ๊ตฌํ˜„ํ•˜๊ฒ ๋‹ค. public int studentId; public String studentName; public String address; //์ƒ์„ฑ์ž ๊ตฌํ˜„๋ถ€ public Student (int id, String name){ studentId = id; studentName = name; //์ดˆ๊ธฐํ™” ํ•˜์ง€ ์•Š์€ address๋ณ€์ˆ˜์—๋Š” null๋“ค์–ด๊ฐ } ๊ธฐ๋ณธ ์ƒ์„ฑ์ž ( Defau..

Language/Java 2020. 9. 4. 19:22
[ JAVA ] ์ธ์Šคํ„ด์Šค, ํž™ ๋ฉ”๋ชจ๋ฆฌ(๋™์  ๋ฉ”๋ชจ๋ฆฌ)

์ธ์Šคํ„ด์Šค ํด๋ž˜์Šค๋กœ๋ถ€ํ„ฐ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ๊ฐ์ฒด ์ƒ์„ฑ์ด ๊ฐ€๋Šฅ, ์ƒ์„ฑ๋œ ๊ฐ์ฒด๋ฅผ ์ธ์Šคํ„ด์Šค๋ผ ํ•จ ๊ฐ€์žฅ ๋งŽ์ด ํ•˜๋Š” ๋น„์œ  ์˜ˆ์‹œ) ํด๋ž˜์Šค -> ๋ถ•์–ด๋นต ํ‹€, ์ธ์Šคํ„ด์Šค -> ๋ถ•์–ด๋นต (instance ์˜์–ด๋‹จ์–ด ๋œป ์ค‘์— ์‚ฌ๋ก€๋ผ๋Š” ๋œป์ด ์žˆ๋Š”๋ฐ ์–ด๋– ํ•œ ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•œ ์‚ฌ๋ก€๋ผ๊ณ  ์ดํ•ดํ•˜๋ฉด ์‰ฌ์šธ ๊ฑฐ ๊ฐ™๋‹ค) Student studentLee = new Student(); //studentLee๋Š” Student๊ฐ์ฒด ํƒ€์ž…์˜ ์ฐธ์กฐ๋ณ€์ˆ˜ ํด๋ž˜์Šค๋ช…์œผ๋กœ new ํ‚ค์›Œ๋“œ๋ฅผ ํ†ตํ•ด ์ธ์Šคํ„ด์Šค ๋ฅผ ์ƒ์„ฑ newํ‚ค์›Œ๋“œ๋ฅผ ํ†ตํ•ด ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ๋ฉค๋ฒ„ ๋ณ€์ˆ˜ ( ํด๋ž˜์Šค๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ์†์„ฑ )์€ ๊ฐ ์ž๋ฃŒํ˜•์— ํ•ด๋‹นํ•˜๋Š” ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ์ดˆ๊ธฐํ™”๋จ. ์ž๋ฐ” ๋ฉ”๋ชจ๋ฆฌ ๊ตฌ์กฐ JVM์ด ์‹คํ–‰๋˜๋ฉด ์šด์˜์ฒด์ œ๋Š” JVM์—๊ฒŒ ํ•„์š”ํ•œ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ํ• ๋‹นํ•จ ( ์ปดํ“จํ„ฐ๊ฐ€ ํ”„๋กœ๊ทธ๋žจ์„ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ๋ฉ”๋ชจ๋ฆฌ = ๋ฉ”์ธ..

Language/Java 2020. 8. 22. 22:16