+ 2
Wht is the function can compare tow variable
4 Answers
+ 11
compareTo() method is used  to compare two strings and it returns zero if two Strings are same, less than zero if calling string comes before argument string and greater than zero if calling string comes later than argumentstring as shown in example below.Â
String tv = "Bravia";
String television = "Bravia";
if (tv.compareTo(television) == 0) {
       System.out.println("Both tv and television are equal using compareTo method of String");
     }
+ 1
in c++ u can use
strcmp(...1...,...2);
2 cmpre 2 strings
0
thx 4 info
0
if int can use == ?