DevHunters.com l Webmaster Forum - Web Advertising - Web Design - SEO Forums  

Go Back   DevHunters.com l Webmaster Forum - Web Advertising - Web Design - SEO Forums > Webmaster / Coding / Web Design Discussion > JavaScript Programming

JavaScript Programming Discuss javascript coding.

Have A Look At Some Of Our Webmaster Related Sponsors!


Script Directory


Shopping Cart


Market Leverage


Free Templates

3D Guide-Characters
3D Guide-characters

social bookmarking network
Advertise Here

Reply
 
LinkBack Thread Tools Display Modes
Old 01-09-2008, 11:34 AM   #1 (permalink)
New Hunter
 

Join Date: Dec 2007
Posts: 4
iTrader: 0 / 0%
Hunter Bux: 10.00
caldwell880 is on a distinguished road
Default java question

What is the difference between an Interface and an Abstract class?
__________________
research papers term papers
caldwell880 is offline   Reply With Quote
Old 01-09-2008, 02:58 PM   #2 (permalink)
Senior Moderator
 
SpOrTsDuDe.Reese's Avatar
Default

Well they are almost the same. An abstract class may contain complete or incomplete methods. Interfaces can contain only the signature of a method but no body. Thus an abstract class can implement methods but an interface can not implement methods. An abstract class can contain fields, constructors, or destructors and implement properties. An interface can not contain fields, constructors, or destructors and it has only the property's signature but no implementation. An abstract class cannot support multiple inheritance, but an interface can support multiple inheritance. Thus a class may inherit several interfaces but only one abstract class. A class implementing an interface has to implement all the methods of the interface, but the same is not required in the case of an abstract Class. Various access modifiers such as abstract, protected, internal, public, virtual, etc. are useful in abstract Classes but not in interfaces. And most importantly Abstract classes are faster than interfaces.
SpOrTsDuDe.Reese is offline   Reply With Quote
Old 06-18-2008, 05:33 AM   #3 (permalink)
New Hunter
 

Join Date: Jun 2008
Posts: 4
iTrader: 0 / 0%
Hunter Bux: 0
Edda is on a distinguished road
Default

An Abstract Class can contain default Implementation, where as an Interface should not contain any implementation at all. An Interface should contain only definitions but no implementation. where as an abstract class can contain abstract and non-abstract methods. When a class inherits from an abstract, the derived class must implement all the abstract methods declared in the base class. an abstract class can inherit from another non-abstract class.
Edda is offline   Reply With Quote
Reply

Bookmarks

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 On



All times are GMT -5. The time now is 08:41 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
vBCredits v1.4 Copyright ©2007, PixelFX Studios