Files
WoofWare.PawPrint/WoofWare.PawPrint.Test/sourcesPure/IsInstSimpleInheritance.cs
2025-06-27 11:41:41 +01:00

26 lines
446 B
C#

public class Program
{
public class Vehicle
{
public int Wheels { get; set; }
}
public class Car : Vehicle
{
public string Model { get; set; }
}
public static int Main(string[] args)
{
Car myCar = new Car { Wheels = 4, Model = "Tesla" };
// 'is' operator uses isinst instruction
if (myCar is Vehicle)
{
return 42;
}
return 0;
}
}