public class MatchStrings { public static void main(String args[]){ String string1 = "Hello World "; String string2 = "java"; String string3 = "Hello World java"; string1 += string2; System.out.println("Try"); if(string1.equals(string3)){ System.out.println("s1 and s3 are equls"); }else{ System.out.println("s1 and s3 are different"); } } }
沒有留言:
張貼留言