• 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

interface and abstract real time Advantages

 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys ...
let me know real time issues where it absract and interface will be used ...
Since java denies multiple inheritance , so we will be using interface ...
wher in the case trully speaking mul;tiplr inheritance we have neither implemented mtds but interfaces is noit like that ..
class which implenmnts sud provide the defn then what is use
Thx in advnace
Gowtham gowtham.ganamukala@gmail.com
 
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One word: Polymorphism. That's the use...
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, thats one of the main benefits of OOP, polymorphism.

For instance, you can have an interface as:




now I may have many classes such as Ferrari, Porche etc.. which can benefit by using this public abstract method of the interface car w/o having to rewrite the method again and again. Also we can set some variables in the interface (which btw, are public static and final by default) and benefit by using them in various classes.

Hope this helps.

-Kiennjal
[ March 30, 2005: Message edited by: kiennjal shah ]
reply
    Bookmark Topic Watch Topic
  • New Topic