TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sankar s
NA
9
1.4k
Why We Need Interface?
Feb 14 2013 12:14 AM
I have a doubt on interface. My question is why exactly i need interface? i read few articles in the net but none of them explained me clearly.
1.) Every one just say
interface is a contract that can be implemented in a class.
2.) They just give an example of Idisposable, IComparable etc.
3.) My question is when i implement interface called ICompareable i should and must use CompareTo() method i agree, my question is that in CompareTo() method i will be writing the logic. So wy do i need to implement Icomparable interafce? I can write the method directly in a base class and i can use that method in derived calss?
Reply
Answers (
4
)
SELECT ALL SHEETS IN BOOK
c# Filesystem watcher to pick and convert XML encoding