Geeks Talk

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.

interface

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?...

Go Back   Geeks Talk > Software Development > C#
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 09-14-2009
Junior Member
 
Join Date: Jun 2009
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
ashina1111 is on a distinguished road
interface

What is use of interface? Why we actually use it?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-14-2009
Junior Member
 
Join Date: Jan 2007
Location: pune
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
jkpawar is on a distinguished road
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.
Reply With Quote
  #3 (permalink)  
Old 09-14-2009
Expert Member
 
Join Date: May 2009
Location: Bangalore
Posts: 991
Thanks: 155
Thanked 420 Times in 201 Posts
rijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nice
Re: interface

Quote:
Originally Posted by ashina1111 View Post
What is use of interface? Why we actually use it?

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.
Reply With Quote
Reply

  Geeks Talk > Software Development > C#

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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


All times are GMT -4. The time now is 12:06 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved