Funny Answers for Public, Private and Protected

Generally I don’t post this type of post here. As a Sr Developer, generally I have to take interviews of php developers. Its a great fun to take a interview of the people specially for me.

This is because I get some funny answers to my question. I have got lots of funny answers generally from freshres but some times from experienced persons also.

But for today I have taken two interviews and got some extra ordinary answer for the same question. Actually these answers are forcing me to write this post.

Question was:

What is the difference between Public, Private and Protected?

My intention was to check their oop concepts. But here is what I got:

Answer 1 :

Every one can access public, no one can access private and some one can access protected.

Answer 2 :

( Actually this person was very eager to answer this question )

public methods can be accessed by the guest of the website, private methods can be accessed by the logged in user and protected methods can be accessed by some special users of the website.

You can also share your experience here.

Related Posts

Written by Avinash

Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.

View all posts by: