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