Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
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");
	}

}

the output:
True1
True2
True3
True4
False5
Posted
Comments
ridoy 3-Jan-16 8:32am    
You know that's nowhere near a question!?

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900