code of c#
void method(int a)
{
int b = get(a);
if ( b == 0 )
{
throw new NullReferenceException();
}
}
If I throw NullReferenceException, it will generate a warning, and it is not a good way.
So if there is any exception instead of NullReferenceException ? I found the ArgumentNullException, but it is not very proper to this code, because the b is not an argument.