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
- MacOS
- data structure
- Class
- DS
- function
- system
- while
- DATAPATH
- github
- architecture
- DB
- DoM
- Pipelining
- php
- instruction
- mysql
- html
- react
- MIPS
- web
- control
- XML
- Algorithm
- Linux
- for
- computer
- CSS
- javascript
- python
- Java
Archives
- Today
- Total
목록Pass by Reference (1)
YYYEJI
[JAVA] Pass by Value와 Pass by Reference의 차이점
Pass by Value는 복사된 값이 전달되는 방식으로, 원본 값에 영향을 주지 않습니다. 즉 들어온 caller와 callee의 파라미터는 서로 다른 변수입니다. 아래는 Pass by Value에 관련된 예제입니다. public static void main(String[] args) { int a = 1; System.out.println("a before function call: " + a); int result = sum(a, a); System.out.println("The result is " + result + "."); System.out.println("a after function call: " + a); } private static int sum(int a, int b) { re..
Java
2022. 12. 26. 19:01