Banner

My Tech Blog (isDivide)

โœ… ๋ฌธ์ œ๋‘ ๊ฐœ์˜ ์ •์ˆ˜๋ฅผ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋ฐ›์•„ ์•ž์˜ ์ •์ˆ˜๊ฐ€ ๋’ค์˜ ์ •์ˆ˜๋กœ ๋‚˜๋ˆ„์–ด์ง€๋Š”์ง€๋ฅผ ํŒ๋ณ„ํ•˜๋Š” ๋ฉ”์†Œ๋“œ isDivide()๋ฅผ ์ž‘์„ฑํ•˜์„ธ์š”.์ด ๋•Œ, ๋‚˜๋ˆ„์–ด์ง€๋ฉด true, ๋‚˜๋ˆ„์–ด์ง€์ง€ ์•Š์œผ๋ฉด false๋ฅผ ๋ฐ˜ํ™˜ํ•จโœ… ์ฝ”๋“œpublic class Main { public static void main(String[] args) { int num1 = 10; int num2 = 2; boolean result = isDivide(num1, num2); System.out.println("๊ฒฐ๊ณผ ํ™•์ธ : " + result); } public static boolean isDivide(int num1, int num2) { return num1 % num2 == 0; }} ์ž๋ฐ”์—์„œ ๋ฉ”์†Œ๋“œ ๋งŒ๋“ค ๋•Œ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ๊ฒƒ!! โ˜…ma..
์ธ์ ˆ๋ฏธ์˜€๋˜๊ฒƒ
'isDivide' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก
์ƒ๋‹จ์œผ๋กœ