If I have
class Class1
{
string message { get; set; }
int age { get; set; }
public Class1(string msg, int ageof)
{
message = msg;
age = ageof;
}
and am passing the parameters from another class in to the constructor...
class Program
{
static void Main()
{
Class1 type = new Class1("HELLO",17) ;
}
}
Could anyone tell me how I could then make "message" and "age" hold the values passed in from class program...
I understand why the values do not hold but do not know how (if I could) use the ref or out keyword in these circumstances..
Basically I want the values to hold in my two variables then be able to write the values of them from class program...
Just a little practice that I am doing...thanks