Types and Casting
Types and Casting
How to work
with inheritance
Product
(base)
Book Software
(subclass) (subclass)
Syntax:
if (p.GetType() == typeof(Book))
if (p.GetType().Name == nameof(Book))