• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Is this multiple inheritance  RSS feed

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
interface a
{
}
interface b
{
}
interface c extends a,b
{
}
public class temp
{
public static void main(String args[])
{
System.out.println("test message");
}

}
See interface c.Can we say this is multiple inheritance??
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMO -
I think the term "multiple inheritance" is applicable
only for classes and not for interfaces. Here you are
creating a hierarchy of interfaces.
Since c itself is declared as an interface and not
a class, compiler does not apply the multiple inheritance
check here. If you declare c as a class and try to
compile your code, among other error messages is one
which says Multiple inheritance is not supported.
I hope this substantiates my argument
However, I am very curious to know if creating
such (multiple)inheritance interface hierarchies
is a good design practice. Also, is there any
example for such interface(s)?
Ajith
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!