Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- for문
- private
- After effects
- 반복문
- Override
- 배열
- do while문
- symbol
- while문
- 조건문
- 생성자
- Java
- length
- expand
- Photoshop
- illustrator
- Interface
- 상속
- 멤버변수
- switch문
- 파라미터
- if문
- super
- Overload
- 클래스
- Singleton
- 변수
- static
- 형변환
- 메서드
Archives
- Today
- Total
Ms'Note
Method-4 본문
다른 메서드를 호출하는 메서드
- f1()은 f2()를 호출하고 있다.
public class Main04 {
public static void main(String[] args) {
System.out.println(f2(100));
}
public static int f1(int x) {
return x + 1;
}
public static int f2(int x) {
// 다른 메서드의 호출
return f1(x) + 1;
}
}
출력 결과
102
Comments