Problem with your code is that you cant set a function. You have to use a property with both
get
and
set
. Then you can create a new instance of your object (in this case TestClass) and set the value of it's properties.
public class TestClass
{
public int MyNumericValue {get; set; }
}
public void program()
{
test t = new TestClass();
t.MyNumericValue = 8;
Console.WriteLine(t.MyNumericValue);
}