Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
I know,I tried that before, the code compiled but didnt work.I actually have solved the problem by using a Collections class.But i wud still like to know how to create an array of the objects of a class which requires a parameter in the constructor.Here is my solution , just the main partpublic class ClientCollection : System.Collections.CollectionBase{ public ClientCollection(Policy MyPolicy) { for(int i=0; i< MyPolicy.PeopleCount;i++) { CClient myClient = new CClient(MyPolicy); this.Add(myClient); myClient = null; } }......................
I know,I tried that before, the code compiled but didnt work.
I actually have solved the problem by using a Collections class.
But i wud still like to know how to create an array of the objects of a class which requires a parameter in the constructor.
Here is my solution , just the main part
public class ClientCollection : System.Collections.CollectionBase
{
public ClientCollection(Policy MyPolicy)
for(int i=0; i< MyPolicy.PeopleCount;i++)
CClient myClient = new CClient(MyPolicy);
this.Add(myClient);
myClient = null;
}
......................