I have been given this assignment to be completed and I am stuck at the first step. Here are the requirements. I have 4 files:
Parent is abstract class
Modify child1.cs and child2.cs so that they are nested classes within Parent class
Make sure child1 and child2 classes can only be created by Parent class
Create a static method in Parent class which takes string parameter and if string is 'Child1' return child1 else return child2
Method in the form1.cs that creates and instance of parent class.
I am not sure how to make them as nested classes ...if I need to create partial classes then how do I do that.
How do I make sure that child classes can only be created by parent class?
View Complete Post