string作为参数传递 day11
package com.shujia.day11;
public class string {
public static void main(String[] args) {
String s1 = "hello";
String s2 = "world";
System.out.println("s1: " + s1 + ", s2: " + s2);
fun1(s1, s2);
System.out.println("s1: " + s1 + ", s2: " + s2);
}
public static void fun1(String s1, String s2) {
s1 = s2;
s2 = s1 + s2;
System.out.println("s1: " + s1 + ", s2: " + s2);
}
}