J
Jon Wallace
Hey Guys 'n' Gals,
I'm somewhat of a new-comer to ASP.NET and OOP for that matter and just
wanted a sanity check on the use of classes.
Here is my example:
Let's say have have 2 classes named ClassA and ClassB
public class ClassA
{
public string sData1 { get; set; }
public string sData2; { get; set; }
public ClassA()
{
}
}
public class ClassB
{
public string sData1 { get; set; }
public string sData2 { get; set; }
public ClassB()
{
}
}
Now - I have a third class, ClassC and I want it to have members which are
of the ClassA and ClassB - is this the correct way to define this?
public class ClassC
{
public ClassA cA = new ClassA();
public ClassB cB = new ClassB();
public string sData1 = { get; set; }
public string sData2 = { get; set; }
public ClassC()
{
}
}
Thanks for your help,
Regards,
Jon
I'm somewhat of a new-comer to ASP.NET and OOP for that matter and just
wanted a sanity check on the use of classes.
Here is my example:
Let's say have have 2 classes named ClassA and ClassB
public class ClassA
{
public string sData1 { get; set; }
public string sData2; { get; set; }
public ClassA()
{
}
}
public class ClassB
{
public string sData1 { get; set; }
public string sData2 { get; set; }
public ClassB()
{
}
}
Now - I have a third class, ClassC and I want it to have members which are
of the ClassA and ClassB - is this the correct way to define this?
public class ClassC
{
public ClassA cA = new ClassA();
public ClassB cB = new ClassB();
public string sData1 = { get; set; }
public string sData2 = { get; set; }
public ClassC()
{
}
}
Thanks for your help,
Regards,
Jon