[10์ผ์ฐจ] ๋ฐฐ์ด Array (2)
Ex34 ~ Ex35 ๋ฐฐ์ด์ ๋์์ผ๋ก ์์ฃผํ๋ ๋ฉ์๋ ๊ฒ์ - boolean contains(๋ฐฐ์ด, ๊ฒ์๋์) int[] nums = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; if (contains(nums, 15)) { System.out.println("๋ฐ๊ฒฌํจ"); } else { System.out.println("๋ฐ๊ฒฌ๋ชปํจ"); } String[] colors = { "red", "yellow", "blue", "white", "black", "green", "purple", "gold", "silver" }; if (contains(colors, "skyblue")) { System.out.println("๋ฐ๊ฒฌํจ"); } else { System.out.println("๋ฐ๊ฒฌ๋ชป..
[5์ผ์ฐจ] ๋ฉ์๋(Method), ๋ฉ์๋ ์ค๋ฒ๋ก๋ฉ, ์ง์ญ๋ณ์(Local Variable)
Ex22 ~ Ex28 ๋ฉ์๋, Method - ๋ฉ์๋(Method), ํจ์(Function), ํ๋ก์์ (Procedure), ์๋ธ๋ฃจํด(subRutine) - ์ฝ๋์ ์งํฉ - ๊ฐ์ ๋ชฉ์ ์ ๊ฐ์ง ์ฝ๋์ ์งํฉ ๋ฉ์๋ ์ ์ธํ๊ธฐ(์์น๋ class ๋ด๋ถ) ์ ์ธ๋ถ, ์๊ทธ๋์ฒ(sign) -public static void hello () -์ ๊ทผ์ง์ ์ ์ ์ ํค์๋ ๋ฐํ์๋ฃํ ๋ฉ์๋๋ช
์ธ์๋ฆฌ์คํธ ๊ตฌํ๋ถ(Body) - ๋ฉ์๋๊ฐ ํ๋ ค๋ ์
๋ฌด ์ฝ๋ ๊ตฌํ ๋ฉ์๋ ์ธ์๋ฆฌ์คํธ - ์ธ์๋ฆฌ์คํธ, ์ธ์(Arguments), ํ๋ผ๋ฏธํฐ(Parameter) - ๋งค๊ฐ๋ณ์ - ๋ฉ์๋๋ฅผ ํธ์ถํ ๋ ๊ฐ์ ์ ๋ฌํด์, ๋ฉ์๋ ๋ด์์ ์ฌ์ฉํ ์ ์๊ฒ ํด์ฃผ๋ ์ญํ - ๋ฉ์๋ ํ์ฉ๋๋ฅผ ๋์ฌ์ค๋ค. > ๋ฉ์๋ ๊ฐ์ฉ์ฑ ***ํธ์ถํ ๋ ์ฃผ์์ 1. ์ธ์๊ฐ์ ์์ 2...