daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Oct 16th, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var obj = new Student("Muhammad");
  2. var obj2 = new SpecialStudent("Muhammad", "Siddiqi");
  3.  
  4. Console.WriteLine(
  5.             "Is IStudent: {0}, Is Student: {1}, Is SpecialStudent: {2}",
  6.             obj is IStudent,
  7.             obj is Student,
  8.             obj is SpecialStudent); //True, True, False
  9.  
  10. Console.WriteLine(
  11.             "Is IStudent: {0}, Is Student: {1}, Is SpecialStudent: {2}",
  12.             obj2 is IStudent,
  13.             obj2 is Student,
  14.             obj2 is SpecialStudent); //True, True, True
  15.  
  16. Console.WriteLine(
  17.             "Is Student Object implements ICalculator<int> interface: {0}",
  18.             obj is ICalculator<int>); //False
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top