Search your topic here

String program 4

public class equaldemo {

            /**
             * @param args
             */
            public static void main(String[] args) {
                        // TODO Auto-generated method stub
String s1 = "Hello";
String s2 = "Hello";
String s3 = "Good bye";
String s4 = "HELLO";
System.out.println(s1+ "equals" +s2+ "is" +s1.equals(s2));
System.out.println(s1+ "equals" +s3+ "is" +s1.equals(s3));
System.out.println(s1+ "equals" +s4+ "is" +s1.equals(s4));

            }


}

LEAVE A REPLY