public class object
{
public static void main(String[] args)
{
String well="hello";
String good="hello";
if(well.equals(good))
System.out.println("good");
}
}
public class object
{
public static void main(String[] args)
{
String well="hello";
String good="hello";
if(well.equals(good))
System.out.println("good");
boolean first=well.equals(good);
System.out.println(first);
boolean test="hello".equals("well"); //equals两侧应为对象,而布尔类型值,数值,字符都不可以最为对象,但是字符串可以
System.out.println(test);
}
}