public class Animal { // code for the Animal class } public class Cat : Animal { // code for the Cat class } public class Dog: Animal { // code for the Dog class } // check if Cat is a subclass of Animal bool result = typeof(Cat).IsSubclassOf(typeof(Animal)); // check if Dog is a subclass of Animal bool result2 = typeof(Dog).IsSubclassOf(typeof(Animal));In this code example, we first define the Animal, Cat, and Dog classes. Then, we use the IsSubclassOf function to check if the Cat and Dog classes are derived from the Animal class or not. The result of these checks will be stored in the "result" and "result2" variables. The package library for the System IsSubclassOf function is the System.Reflection package. This package provides types that enable you to obtain information about loaded assemblies, modules, and types. The IsSubclassOf function is defined in the Type class, which is part of the System.Reflection namespace.