Tag Archives: object oriented programming

What is Inheritance?

Today we’ll take a look at inheritance* – the second cornerstone of object oriented programming, as explained in my 5 minute guide to OOP. In that post, I described inheritance as the ability of objects to derive behaviour patterns from other objects. But what does this mean in practice? An object can inherit behaviour (in […]

Polymorphism Example in C++

If you’ve read my 5 minute guide What Is Polymorphism? and want to see it in action, here’s some C++ code that illustrates the example I mentioned in that post. I’ve kept the code to header files only for brevity, but as you well know, in the real world, objects would be split out into […]

What is Polymorphism?

I was once asked in an interview, “Can you tell me what polymorphism is?” A straightforward enough question. Or is it? This can be exactly the kind of question that catches you off guard. You’ve used objects for years and of course you know what polymorphism is. But can you explain it in a concise […]

What is Object Oriented Programming?

OK, over the next few weeks we’re going to step back a bit from code and command, and instead take a straightforward look at object oriented programming, or OOP*. Why? Because it’s often something that crops up in interviews, and the main concepts are things that all programmers should be able to rattle off and […]