`

JAVA基础1:面向对象

 
阅读更多

 

 

 

 

字符串:

package com.test.base;

public class StringTest {
	public static void main(String[] args) {
		String s1 = new String("aaa");
		String s2 = new String("aaa");
		System.out.println(s1 == s2);
	}
}

 打印结果为false,下图为分析过程

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics