+ 2
String s1 == string s2 produce the output as false while we assuming the same string in both s1 and s2..
3 Réponses
+ 1
ex :
string s1="manivannan";
string s2=new string("mani"+"vannan");
system.out.println(s1==s2);
op:false
why.??
+ 1
Because, both of them have different memory address. As == will check the given variable's address rather than its content.