📄 swapattempt.java
字号:
public class SwapAttempt { public static void swap( String s1, String s2 ) { // these statements are legal but they have no // effect on the variables in the calling method String temp = s1; s1 = s2; s2 = temp; } public static void main( String args[] ) { String s1 = "First String"; String s2 = "Second String"; swap(s1, s2); // the object references are unchanged System.out.println("After the swap"); System.out.println("s1 is " + s1); System.out.println("s2 is " + s2); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -