This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VariableExchangeExample { | |
public static void main(String[] args) { | |
int x = 3; | |
int y = 5; | |
System.out.println("x:" + x + ", y:" + y); | |
int temp = x; | |
x = y; | |
y = temp; | |
System.out.println("x:" + x + ", y:" + y); | |
} | |
} |
반응형
'Programming > 자바(java) - Web, Mobile' 카테고리의 다른 글
자바(java)/ 기본타입과 참조타입의 null 할당 (0) | 2023.07.13 |
---|---|
자바(java)/ 레이블(label) (0) | 2023.07.13 |
JavaSE와 JDK와 JRE 비교 (0) | 2023.07.13 |
자바(java)/ 인텔리제이(IntelliJ), 이클립스(eclipse) mysql 연동 (1) | 2023.07.13 |
이클립스(eclipse)/ 한글 깨짐 관련 (0) | 2023.06.24 |