• 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

how java avoid multiple inheritance

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
by which technique java avoid multiple inheritance
as per specification java does not allow multiple inheritance
what is the perfect technique to achieve this process
Thanks and Regards
Charan
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
having the compiler reject any attempt to do it
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is possible to write an entire API Specification without using multiple inheritance or even inheritance at all.

http://contractualj.com/


All classes are declared final. Concrete behaviour inheritance is not permitted.


It is even possible to avoid contract/interface inheritance, since these types in Java are static (implying some knowledge about the future as does any static inheritance). However, this has drawbacks as opposed to avoiding concrete behaviour inheritance where the cost/benefit is to an extreme (read: infinity) such that it should always be avoided.
Benefit > 0
Cost == 0
x/0 == infinity - for all x > 0

The "techniques" for doing so have been described in many ways over the years. I prefer something like "as accurate as possible, a specification of requirement for the software, conceding to the fact that one must fall infinitely short of a complete specification - implied by the tools at hand" - which contains an awful paradox within if you look close enough.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's even possible to write an entire programming language without inheritance...
Pascal, Cobol, C, Progress, Assembler, Fortran, etc. etc.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's also possible to write a program using entirely Whitespace. (I used to think this language consisted entirely of whitespace characters, but now I see non-whitespace characters are simply ignored.)
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure, however, I am restricting my context to Java in my comments above. I agree - the possibilities are awesome if you abandon this context
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tony Morris:
The "techniques" for doing so have been described in many ways over the years. I prefer something like "as accurate as possible, a specification of requirement for the software, conceding to the fact that one must fall infinitely short of a complete specification - implied by the tools at hand" - which contains an awful paradox within if you look close enough.



Long winded way of saying "Do they best you can with what you've got" isn't it?
 
reply
    Bookmark Topic Watch Topic
  • New Topic