Im currently struggling to find a solution to an exercise. How can i modify ClassA so that the explicit typeconversion in the second part is possible?
class ClassA {
public int MyValue = 0;
public string MyText = "Hello World!";
//Code to impl
}
ClassA myObject = new ClassA();
myObject.MyValue = 42;
myObject.MyText = "Hi!"
int x = (int)myObject;
string str = (string)myObject;