I have been away for a while now but every time I think I won’t need to lay a hand on C++ or any object oriented programming language I find my self mandated to do so. So I thought It would be helpful for people like me to look at this post if they got lost and forgot some of the basic concepts.

In this post, I will talk specifically about the difference between public, private and protected key words. To explain this I will use the House analogy. This House analogy I came across long time ago when I was looking for the difference between those keywords. Anyhow, let’s get into business.

For you to picture this correctly, think about three things that you have in your house,

Now let’s say that the house represent s the Class that you are working on. Then what does those three items presented above represents ?

I know this example might not be perfectly valid compared to really life, but I hope at least that the message is conveyed.

Thanks for viewing.