C Sharp (C#) - Polymorphism and Abstract Classes
Which of the following is the correct way to check if
obj is a bool and assign it to b?obj is a bool and assign it to b?if (obj is Type variable).bool. if (obj as bool b) uses invalid syntax with as. if (obj == bool b) is syntactically incorrect. if (obj is bool) checks type but does not assign.is and variable assignment [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions