#229 – The Core Principles of Object-Oriented Programming

As an object-oriented language, C# supports the three core principles of object-oriented programming:

  • Encapsulation – Hide implementation details in a class from users of the class, exposing only a public interface
  • Inheritance – Derive a subclass from a parent class, inheriting data and behavior from the parent, in an “is-a” relationship.  Inheritance defines a hierarchy of classes.  All classes ultimately inherit from System.Object.
  • Polymorphism – Any subtype may be used where a parent type (or type higher up in the class hierarchy) is expected.  Conversely, a variable of a particular class will be treated as the appropriate subclass.
Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

4 Responses to #229 – The Core Principles of Object-Oriented Programming

  1. Pingback: #251 – Class Properties Support the Principle of Encapsulation « 2,000 Things You Should Know About C#

  2. Pingback: #685 – Inheritance Can Break Encapsulation « 2,000 Things You Should Know About C#

  3. Pingback: #697 – Encapsulation is Managed through the Use of Access Modifiers « 2,000 Things You Should Know About C#

  4. Ivan Fridrich says:

    Abstraction is missing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: