C Sharp (C#) - Polymorphism and Abstract Classes
Which of the following correctly uses the
is operator to verify if obj is an instance of Employee?is operator to verify if obj is an instance of Employee?is operatoris operator checks if an object is compatible with a given type and returns a boolean.if (obj is Employee). if (obj as Employee) is invalid because as returns an object or null, not a boolean. if (obj == Employee) compares an object to a type, which is invalid. if (obj instanceof Employee) uses Java syntax, not C#.is operator [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions