|
There is a variable of type object, it may be an integer, small integer, large integer, may be a Boolean value,
The question now is how do I know if the value represented by the variable of this object is 0 or boolean False.
If the variable of this object is obj,
short sv = 0;
object obj = sv;
So how do I show that obj is the value of 0 at this time?
Yes: obj == (short) 0 ???
Also possible:
long lv = 0L;
object obj = lv;
What about this time?
Do I want to compare all (short) 0, (long) 0, (int) 0; false ... etc. one by one?
Only this question is because
object.Equals (lv, 0) cannot be compared.
Do you know what the problem is? |
|