Skip to content

"Is" and "As"

Mario Gutierrez edited this page Jan 7, 2017 · 2 revisions

"As" Keyword

Null if not type.

Deck d = someObject as Deck;
if (d != null) d.Shuffle();

"Is" Keyword

False if not type.

if (someObject is Deck)
{
  ((Deck)someObject).Shuffle();
}
Clone this wiki locally