equals and == difference
By veladitya
@veladitya (82)
India
4 responses
@veladitya (82)
• India
14 Aug 07
hi....
sory to all
s1=s2; == System.out.println(s1==s2);
similarly to all the statements
@dj_faheem (738)
• Pakistan
9 Sep 07
first of all that
s1=s2;
s1==s2
seond one is
if u consider
s1==s2;
s2==s3;
s3==s4;
s4==s1;
when s1==s2--output abc
when s2==s3---output is not abc coz both string define in diff methods
when s3==s4---output abc
when s4==s1----output is not abc coz both string define in diff methods
@mnvamsi (539)
• India
4 Aug 07
for the above programme if u print the values if s1,s2,s3,s4 the output is nothing more than "abc"
but if you compare like this s1==s2;s2==s3;s3==s4;s4==s1;
n print the values of s1,s2,s3,s4
this will cause in 4 errors i.e "s1==s2 is not a statement" 4 errors like this..