• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

diff b/w ABSTRACT class and INTERFACE.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi friends,
I would like to know the exact difference between
an ABSTRACT class and an INTERFACE.
Which would suit the exact requirement.
thanks in advance
regards
- mohan
 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
interface is to help java programmers to implement multiple
inheritance.Your class has to implement an interface or
multiple interfaces.Similarly one interface can extends other interface as well

whereas "abstract"class can not be instantiated.
Hope this helps.
regds
NM
 
Ranch Hand
Posts: 103
Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Mohan,
I would like to add more difference,
-In interface, the methods will not be having any 'body'(definition) but in abstract classes methods r allowed to have body.
- In interface if u define any variables then it will be implicitly public, as well methods also. But not so in abstract classes.
------------------
Anil Kollur
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic