Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Talk to Webmaster Tony John
Online Members
baskar
More...
Forums
»
.NET
»
ASP.NET
»
Diff b/w interface abstract class ?
Posted Date:
11 Sep 2009
Posted By::
Vinod Krishna
Member Level:
Gold
Member Rank:
890
Points
: 1
Responses:
3
can we create object 4 interface or not ?
Tweet
Responses
#423272 Author:
Sudeep Syamnath
Member Level:
Gold
Member Rank:
933
Date: 11/Sep/2009 Rating:
Points
: 2
Hello Vinod,
We cannot instantiate an interface or an abstract class.
Best Regards,
Sudeep Syamnath
PS: Please rate the answer
#423323 Author:
Elampooranan
Member Level:
Silver
Member Rank:
1145
Date: 11/Sep/2009 Rating:
Points
: 2
Unable to create object for interface .Instead you can inherit it from another interface
#423572 Author:
Yuvaraj
Member Level:
Gold
Member Rank:
382
Date: 11/Sep/2009 Rating:
Points
: 2
Diff Between Abstract class & Interface
Interfaces are essentially having all method prototypes no definition but Abstract class can contain method definations also.
In short Interface is a abstract class having all methods abstract.
Both abstract classes and interfaces are used when there is a difference in behaviour among the sub-types extending the abstract class or implementing the interface.
When the sub-types behaviour is totally different then you use an interface, when the sub-types behaviour is partially common and different with respect to the supertype an abstract class is used. In an abstract class the partially common behaviour is given a concrete implementation. Since there is no common behaviour between an interface and a sub-type an interface does not have an implementation for any of its behaviour.
If you create a abstract class writing the abstract keyword in the declaration part then You only can inherit the class. You can not create an instance of this abstract class but can inherit the class and with creating the instance of the derived class you can access the method of the abstract class.
If you use a virtual keyword in a method then you can override this method in the subclass if you wish..
If you create a abstract method then you must override this method in the subclass other wise it shows error in the program.
Yuvaraj.K
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Tweet
Next :
Storing and retreiving image in sql database.
Previous :
Asp.net with c# ,updating in gridview
Return to Discussion Forum
Post New Message
Category:
Related Messages
Validation Controls
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
Active Members
Today
Jivani
(23)
naveensanagase...
(21)
Asheej T K
(20)
Last 7 Days
baskar
(303)
Ultimaterengan
(267)
Rakesh Chaubey
(184)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds