© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
13 replies
moshimoshi

❔ Polymorphism

Can someone help me understand this part of the code? I dont understand why its being written like this...

public class BankBranch
   {
      //
      // This field keep a list of bank accounts.
      // Any type of accounts will be accepted
      // 
      private List<Account> _accounts;

      public BankBranch(string name)
      {
         Name = name;
         _accounts = new List<Account>();
      }

      // Auto-properties
      public string Name { get; set; }
public class BankBranch
   {
      //
      // This field keep a list of bank accounts.
      // Any type of accounts will be accepted
      // 
      private List<Account> _accounts;

      public BankBranch(string name)
      {
         Name = name;
         _accounts = new List<Account>();
      }

      // Auto-properties
      public string Name { get; set; }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Polymorphism
C#CC# / help
2y ago
❔ Polymorphism
C#CC# / help
4y ago
Inheritance and polymorphism
C#CC# / help
5mo ago
Structure of system with polymorphism
C#CC# / help
2y ago