public class Testeguals {
public static void main(Stringl args) throws IOException{
String[] a=new String[5];
boolean b1,b2,b3;
String s1="Hello";
String s2="Hello";
String s3=new String("Hello");
b1=(s1s2);
b2=(s1s3);
b3=s1.equals(s3);
System.outprintln(s1s2);
System.outprintln(s1s3);
System.out.println(s1.equals(s3));
程序运行的结果:
(1)_____
(2)____________
(3)_____________