---
title: "String 引用 与 值 的区别"
author: "ts88"
date: "2013-06-25T11:55:09Z"
tags: []
categories: ["研发管理"]
slug: "string"
draft: false
lastmod: "2013-06-25T11:55:52Z"
id: 1893912
url: "https://ts88.iteye.com/blog/1893912"
---

```
public class Main {
	
	private static String str = "abc";

    public static void main(String[] args) {
        
        String str1 = "a";  
        String str2 = "bc";  
        String str3 = new String("abc");
        String combo = str1 + str2;  
        System.out.println(str == combo);  
        System.out.println(str3 == combo);  
        System.out.println(str == combo.intern());  

        
        
        
    }

}
```

 分析:![](http://dl2.iteye.com/upload/attachment/0086/1653/59a2bddf-1260-3100-9f95-bc1bc78581ae.png)