java传递String参数不会改变原String参数,此处传递的是copy


package numCombine;

public class NumComberAll {

	public static void main(String[] args) {
		// TODO Auto-generated method stub		
		String s = "lll";
		fun(s);
		System.out.println(s);
	}	
	public static void fun(String s){
		s = "ttt";
	}
}
lll

相关文章:

  • 2022-02-03
  • 2021-12-06
  • 2022-12-23
  • 2021-10-07
  • 2021-11-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-07-15
  • 2021-11-13
  • 2021-09-11
相关资源
相似解决方案