I want to change the class of an object dynamically in C#
Thanks,
Santosh
Main Class: handleOperator objOpr = new handleOperator(); Then for object objOpr I need to access the methods for another class Class2 : Means, I want objOpr = new Class2();
Hi,
Your class Class2 must inherit handleOperator.
C#
public class handleOperator { } public class Class2 : handleOperator { }
and then create object like below
handleOperator obj = new Class2();
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.