If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Doing Multiple Inheritance in java

HI Imran ,
I've a decent enough method to overcome the limitation .. and it is being
used currently in UI programming .. using the adapter classes(hope U know
them) .. it uses Inner classes
Suppose U have two classes X and Y which U want to inherit

class X
{}
class Y{}

when U inherit .. actually U want the existing functionality of both the
classes
so U can write a class as

class outer extends X
{
method(a)
{}
class inner extends Y
{}
}

Now follow the reasoning
1)An inner class can access the outer class's members
so the inner class here can access the members the outer class inherited
from X

2)... also as it(the inner class) itself extends Y it has access to the members
of Y ..

so ultimately U have access to both the classes X and Y from the inner class
..

but the reverse is not always true .. ie U may not be able to access the
members of the inner class thru the outer class
Think this will suffice ..
and every one else in case of any errors do suggest the corrections
Rahul