forum

Home / DeveloperSection / Forums / Is the purpose of an interface to hide information?

Is the purpose of an interface to hide information?

Anonymous User240312-Jun-2013

Given that interfaces are also used to help hide information, giving the user only a subset of the possible methods they are allowed to use, and, let's say, I have a Person class and interface IPerson.

Now in main, I'm allowed to do

IPerson testy =newPerson();

or

Person testy =newPerson();

So really I'm not restricted from using Person still. So how does the

interface truly hide data?


Updated on 04-Jul-2023
I am a content writter !

Can you answer this question?


Answer

2 Answers

Liked By