• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic