+2 votes
490 views
in Programming by (560 points)
How can i compare 2 strings?
closed

1 Answer

+1 vote
by (1.5k points)
selected by
 
Best answer


Its very simple you can compare like this only 
String String1 = "XYZ";
String String2  = "XYZ";

if(String1 .equals(String2))
{
    System.out.println("Strings are equal!");
}

Enjoy!

0
by (560 points)
thanks swag31 :) it works.

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated