Skip to content

How do I - Class within a class

Neil

Asked Aug 13, 2006, 5:28 PM EDT1 answer
Share
LinkedInX
I am very new to C# programming and I am trying to find a more efficient way to do what I am trying.  What I wrote works, but its very clunky.

I have an account class, which entails an account number, sub-number and location.  Each account class will have one or more coverages.  Each of these coverages will have integers # of employees, # of insured, # of dependents.

So...

Acct 1  Coverage 8  - 8 emps, 6 insd, 6 deps
Acct 1 Coverage 25 - 2 emps, 2 insd, 1 dep
Acct 2 Coverage 1 - emps insd deps
Acct 3

You get the idea.  It would seem that a Coverage class within the account class would make logical sense, but I find that anywhere in my book to see whether its possible, and searching the web brought me no where.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi, you can do this thing using the nested classes. You can get more information on these in MSDN.
    0