I’ve a string value String str="Success"
How to check the “str” value is not equal to “Success”. If I try if(str!="Success"). It is not working properly.
I’ve a integer value int a=250 If I use If(a!=250) this is also not working properly.
How to code for these conditional statements ? I’m using Android and Eclipse version 2.1.
Any help would be appreciable.
As every one said, String values should compare with
.equalsmethod.like
Next coming to integer comparison.
As you have said, you have the integer value
Here already your a value is 250. then you are executing some lines of code if
avalue isnot equalto 250. Then how the condition will execute. if you want to test thenchange the a value and then check again as