会的,比如 String str = "OhYeah"; System.out.println(str); System.gc();//调用垃圾回收 //str 依然没有被释放除非 str = null; System.gc(); //str对象被终结了 ==================================================== 如果想System.gc();