Answers for "how to get derived class from base class C#"

C#
0

how to get derived class from base class C#

class Base {
	[...]
}

class Derived : Base {
	[...]
}

/* if an instance of the base class is derived you will be able to
cast that instance to it's derrived class, as such: */

Base baseInstance = new Derived();
Derived derivedFromInstance = (Derived)baseInstance;
Posted by: Guest on January-30-2021

Code answers related to "how to get derived class from base class C#"

C# Answers by Framework

Browse Popular Code Answers by Language