困惑1
以前:有点不太明白,关于常量池,栈,堆,方法区,等方面有点搞不清了。
源代码:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 package com.mon11.day18; 2 /** 3 * 类说明 : 4 * @author 作者 :chenyanlong 5 * @version 创建时间:2017年11月18日 6 */ 7 public class Demo { 8 9 public static void changeStr(String str){ 10 str="welcom"; 11 System.out.println(str); 12 } 13 14 public static void main(String[] args) { 15 String str="1234"; 16 changeStr(str); 17 System.out.println(str); 18 } 19 }