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();
hii
In object 'obj' I need methods of class Class2, here I found methods of class handleoperator
You have to implement inheritance as per your requirement.like if you want to access child and parent methods,then you need to create object of child class.
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.