I have a class like this:
public class Student
{
private string NumberP;
public string Number
{
get{return NumberP;}
set{NumberP=value;}
}
}
public class School
{
private string NameP;
public string Name
{
get{return NameP;}
set{NameP=value;}
}
}
I want to declare a Type from another class like (school or Student), but I don’t know its type.
How Can I declare a property unknown type. I will set unknown type another time
public class MyClass
{
public UnKnownType
{
}
}
Since the
StudentandSchooltypes do not have any relationship between them you could use theobjecttype:and use like this:
or make the containing class
generic:and then you could use like this: