Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Can I say that, "Separation of implementation part and data part of Object in programming is Interface".
Posted
Updated 13-Dec-14 9:28am
v2
Comments
PIEBALDconsult 13-Dec-14 15:34pm    
You can, but it's a bit simplistic, so I'd rather you did more research and formulated a broader over-simplification.
There are several articles here on CP that discuss interfaces.
Shaharyaar 14-Dec-14 5:57am    
I made it a bit Broader but i think it still needs several improvements.
Interface : Interface uses Abstraction and Encapsulation principle, structures the traits of Object but does not independently implement itself rather remains just accessible Part.

1 solution

No - not really.

An interface is like a contract or promise. Any code that implements that interface must fulfil the contract or promise. This allows us to separate code into "what a thing can do" rather than "what exactly each thing is".

For example, the steering wheel and pedal lay out of a car is a type of interface. This allows you to drive any car that implements this interface without having to learn separate rules for Peugeot, Jaguar, Ford etc. This same principle applies in software.
 
Share this answer
 
Comments
Maciej Los 14-Dec-14 11:07am    
My 5 is not a contract or promise, is real!
By The Way: I really do like this definition of interface. I need to remember it ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900