public class test { public static void main(String[] args) { int i=9; int j=9 ; if (i==j) System.out.println("True1"); else System.out.println("False1"); String Str1="Hello"; String Str2= "Hello"; //////// Check the Contains of two objects/////////// if (Str1==Str2) System.out.println("True2"); else System.out.println("False2"); //////Check the Contains of two objects/////////// if (Str1.equals(Str2)) System.out.println("True3"); else System.out.println("False3"); String Str3=new String ("Hello"); String Str4=new String ("Hello"); ///// Check Equality of the same Location //////////// if (Str3.equals(Str4)) System.out.println("True4"); else System.out.println("False4"); ///////////////////New Object ////////// if (Str3==Str1) System.out.println("True5"); else System.out.println("False5"); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)