Hi...I am new to object oriented programming and facing a problem with classes and inheritance.
My question is how to call members of one class in to another class.
Here is class 1
Here is Class 2
But when i call it as
The compiler gives error like null reference
Please help
Thanks
My question is how to call members of one class in to another class.
Here is class 1
Code:
class Class1
{
public string Id;
public string Name;
public Class2 Add;
}
Code:
class Class2
{
public string Address;
}
Code:
Class1 a = new Class1();
a.Id = "1";
a.Name ="abc";
a.Add.Address = "def";
Please help
Thanks
Comment