/**
*
*
@author caryt
*
*/
public class test {
/**
*
@param args
*/
static int x[]=new int[15];
public static void main(String[] args) {
// TODO Auto-generated method stub
String t1=new String("caryt");
String t2=new String("caryt");
System.out.println(t1==t2);//比较的是对象的引用
System.out.println(t1!=t2);//比较的是对象的引用
System.out.println(t1.equals(t2));//比较的是对象的spa
}.net
}对象
out: false
true
trueget