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 |
Tags
- react
- system
- DS
- Linux
- data structure
- mysql
- Java
- instruction
- while
- Algorithm
- python
- architecture
- DB
- web
- CSS
- github
- DoM
- MIPS
- XML
- php
- DATAPATH
- javascript
- for
- Pipelining
- MacOS
- control
- html
- Class
- computer
- function
Archives
- Today
- Total
YYYEJI
[JAVA] Format parameter와 Actual parameter 이해하기 본문
728x90
Format parameter는
method를 정의할 때의 parameter를 의미합니다.
즉 아직 값이 없는 상태를 의미하죠.
Actual parameter는
main 함수에서 method가 호출(invoke)되고 실직적인 값이 있는 상태의 parameter을 의미합니다.
코드를 살펴보겠습니다.
public class main {
public static void main(String[] args) {
int result = sum(1, 1);
System.out.println("The result is " + result + ".");
}
private static int sum(int a, int b) {
return a+b;
}
}
Format parameter - main method 밖에 존재하는 sum 함수의 a, b
Actual parameter - main method 안에 존재하는 sum 함수의 1
입니다.
◡̈
'Java' 카테고리의 다른 글
[JAVA] Setter/Getter 메소드 (0) | 2022.12.26 |
---|---|
[JAVA] Pass by Value와 Pass by Reference의 차이점 (0) | 2022.12.26 |
[JAVA] This와 Shadowed field 이해하기 (0) | 2022.12.26 |
[JAVA] Main method 이해하기 (0) | 2022.12.26 |
[JAVA] 클래스 다이어그램(Class Diagram)이란? (0) | 2022.12.26 |