Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on interface within the C# forums, part of the Software Development category; What is use of interface? Why we actually use it?...
|
|||||||
|
|||
|
Re: interface
Interface is actually 100% abstract class whose all the methods have only definition not body. if your class implements any interface then provide body for all the methods.
actually java doesn't support multiple inheritence means ur class cant inherit(extends) more than 1 class. but if u want to inherit more than one class then use Interface. actually we achieve multiple inheritance by Interface. |
|
|||
|
Re: interface
Hi Ashina111, 1) In the concept of data hiding , let's say you want to provide a class to some client code, but don't want to give them full access. One way to restrict access without limiting the functionality of your class is to implement an interface and require the client code to get objects through a factory: 2)Another benefit of interfaces is team development. If you have a dozen programmers working on different pieces of code that need to connect, it's best to define interfaces for the connections. As long as the programmers write according to the interfaces, everything will link together nicely regardless of personal choices and style. 3)Yet another benefit is that with interfaces you can use a class without having defined it first. Eg: If you have a class that does a lot of intricate work and won't be finished before the rest of the project, the rest of the project can use an interface to it and avoid being stalled by the development of that one class. I think its enough to resolve ur query. Thanks, Riju. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Interface | mahasang2k | OOPS | 5 | 08-27-2009 03:23 AM |
| what is an interface | dprakashraj | C# | 1 | 08-25-2009 02:07 AM |
| Component Interface | jain_ash83 | PeopleSoft | 3 | 09-18-2008 03:53 AM |
| COM interface | JobHelper | QTP | 1 | 03-30-2007 02:07 PM |
| interface..... | psuresh1982 | Java | 1 | 01-08-2007 01:40 PM |