• 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
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

multiple inheritance

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does java provide ways to do multiple inheritance? How class B inherit both class A and class B.
 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can only extend one class.
You can implements one or more interfaces though.
 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by catherine matthews:
Does java provide ways to do multiple inheritance? How class B inherit both class A and class B.



About multiple inheritance Sanjaya gave you solution. And about

How class B inherit both class A and class B



No A class cann't extend more then 1 class at a time.

But you misspelt somewhere.

Are you menat this

A class is implicitly inherit ownself



Come up with clear confusion
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, one interesting consideration is that inner classes can inherit independently from their enclosing class. So considering the special "link" an inner class has to its enclosing class, this might be considered a form of multiple inheritance...
 
reply
    Bookmark Topic Watch Topic
  • New Topic