OOP Articles

Explaining C# Abstraction, Inheritence and Polymorphism

Far too often, fundamental programming concepts like inheritance and polymorphism are taught using vague examples, like class "AA" and class "BB". Let's get away from that; they're far too abstract to offer a proper explanation. We'll use a workshop as our example instead. Say you have a program to simulate a workshop, and you want […]

Read more

C# Class Inheritance

This Console-based C# code calculates theArea, perimeter, surface area and volume of the following polygons:square, rechtangle, parellelogram, trapezoid, triangle, circle, cube,prism (both rechtangular and triangular base), cylinder, cone, sphere,pyramid and rhombus. All the user does is to input the polygon'sdimensions and the code will produce the polygon's attributes. polygons.cs

Read more

Objects & Classes in C#

In this article we will understand some of the concepts of object-oriented programming in C# like objects and classes. To read this article you must have C# programming basics. NOTE: read the whole article because there aresome concepts you may will not get the best of it until you finish the article.And we will revisit […]

Read more

Is Object Class, the root of all hierarchies?

IntroductionThis might come as a surprise for many, to see me doubting theinformation presented in almost .NET books even MSDN library but as wedelve deeper into this topic, you will find yourself in the samepredicament as I am now. What is an Object class?For those who arenew to .NET, according to MSDN library – "Object […]

Read more

C# Interface Implementation

Interface implementation can be confusing… I see a feature in C# that can be very confusing. In theexample below we have a class (Test) that implements 2 interfaces(I1 and I2). So the logic says that we should have implementations in the classTest for both MyFunction() methods from I1 and I2. BUT!As you see in the […]

Read more

C# Inheritence

  // author : Martin Raphael.K// email : mrkraj@officetiger.com// Date : November 02, 2001 // This is the sample code for inheritence // new is the keyword which is used to override the base(Parent) class//members base is the keyword whichs is equal to super in javausing System;public class Base{ public string str; public Base() { […]

Read more

C# Encapsulation

INTRODUCTION: The object oriented programming will give theimpression very unnatural to a programmer with a lot of proceduralprogramming experience. In Object Oriented programming Encapsulation isthe first pace. Encapsulation is the procedure of covering up of dataand functions into a single unit (called class). An encapsulated objectis often called an abstract data type. In this article […]

Read more