It's not exactly the same, and the problem appears when you use
inheritance.
I.e.:
WebPage1
inherits from Page
, and this one inherits also from Object
, so if you test for (new WebPage1()).GetType() == typeof(object)
it'll return false because the types are diferent, but when you test using the is
operator it's true.
((new WebPage1()) is object)
is true because (new WebPage1())
is an object of type WebPage1
, and also a Page
and an object
.
The types might be different, but is
checks if you can cast safely to
this type.