Originally posted by sandhi mridul:
Hi,
What is the diffrence between "!=" and "=!" operartor.
As per me this operartor can only be applied on boolean first of all.
Also if
b1 != b2; //line 1
here , its doing comparison between b1 and b2.
If they are not equal to each other then line 1 return true otherwise false.
b1 =! b2; // line 2
Here its doing assignment b2 to b1.
That is if b2 is "false" then due to (!b2) true is going to get assign to b1.
Am I right?
***************************************************************************
One more thing I want to ask-
boolean b1=false;
boolean b2=false;
b2!=b1!=b2; //Line 1
b2!=b1=!b2; //Line 2
Are these 2 lines going to compile and run?
For me its giving error stating "Invalid statement".
Also I am confused.
Please help me out with the above two.
Thanks
[ March 09, 2008: Message edited by: sandhi mridul ]
Hi Sandhi,
what you said is rite.
is comparision and
is Assigment
Instead of this
you can use as
moreover,i dont know why the following check needed
its enough to have as
you may try down as