Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
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 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

chapter03 : Recursiveclass 본문

JAVA/chapter07_method

chapter03 : Recursiveclass

GAWON 2023. 5. 26. 17:47
package org.joonzis.ex;



public class Ex03_RecursiveClass {
	
	static int count = 0;
	
	static void recursive() {
		System.out.println("recursive() call");
		count++;
		if(count == 5) {
			return;		// recursive() 메소드 종료
		}
		recursive();	// 재귀 호출
	}
	
	public static void main(String[] args) {
		recursive();
	}
}

'JAVA > chapter07_method' 카테고리의 다른 글

Test . method  (0) 2023.05.26
Test . oper  (0) 2023.05.26
chapter04 : Triangle  (0) 2023.05.26
chapter02 : local / localmain  (0) 2023.05.26
chapter01 : rect / rectmain  (0) 2023.05.26