|
The approach should be the same. Create 2 more classes: class M1 extends C1 { My implementations } class M2 extends C2 { My implementations } class M { void method() { C1 obj1 = new M1(); C2 obj2 = new M2(); obj1.xxxx() obj2.xxxx(); } } ----- Original Message ----- From: "Mike Silvers" <msilvers@HBS-INC.COM> To: <java400-l@midrange.com> Sent: Thursday, June 27, 2002 11:02 AM Subject: Re: Extending more than one base class.... > Lets try that again...it's not going to work. Both of the base classes are > abstract and need to be extended in order for variables to be accessed. Any > other ideas? > > Mike > > ----- Original Message ----- > From: "Mike Silvers" <msilvers@hbs-inc.com> > To: <java400-l@midrange.com> > Sent: Thursday, June 27, 2002 1:23 PM > Subject: Re: Extending more than one base class.... > > > > Bruce, > > > > Great Idea.... I think it will work in this instance. > > > > Thanks! > > > > Mike > > > > ----- Original Message ----- > > From: "Bruce Jin" <JIN007M@hotmail.com> > > To: <java400-l@midrange.com> > > Sent: Thursday, June 27, 2002 3:10 PM > > Subject: Re: Extending more than one base class.... > > > > > > > You may have to use contain instead of inheritance. The 2 classes from 2 > > > vendors may have variables/methods having the same names. Have your > class > > > contain the other 2 classes will allow you to access variables/methods > in > > > each class correctly. Say your class is M and the vendor's classes are > C1 > > > and C2 > > > > > > class M { > > > > > > void method() { > > > > > > C1 obj1 = new C1(); > > > C2 obj2 = new C2(); > > > > > > obj1.xxxx() > > > obj2.xxxx(); > > > > > > } > > > > > > ----- Original Message ----- > > > From: "Mike Silvers" <msilvers@HBS-INC.COM> > > > To: <java400-l@midrange.com> > > > Sent: Thursday, June 27, 2002 7:15 AM > > > Subject: Extending more than one base class.... > > > > > > > > > > All, > > > > > > > > I need to extend more than one base class for a specific class. Both > > > > classes are from commercial packages, so I do not have the source for > > > them. > > > > I can not use an interface for either of them. Obviously, I can't > > extend > > > > both of the classes for this class. Does anyone have any ideas to > work > > > > around this Java restriction? > > > > > > > > Thanks > > > > > > > > Mike > > > > > > > > ================================ > > > > Mike Silvers > > > > AS/400 Senior Programmer/Analyst > > > > AS/400 IBM Certified RPG IV Developer > > > > AS/400 IBM Certified Solutions Expert > > > > Hainey Business Systems > > > > 8 E. Canal St > > > > Dover, PA 17315 > > > > Branch Office: (410) 397-8739 > > > > Phone: (800) 932-3380 ext. 237 > > > > Fax: (717) 292-9474 > > > > Web: http://www.hbs-inc.com > > > > ________________________________ > > > > Providing E-Commerce, EDI, AS/400 > > > > Development, Java Development, > > > > and related services nationwide. > > > > ================================ > > > > > > > > > > > > _______________________________________________ > > > > This is the Java Programming on and around the iSeries / AS400 > > (JAVA400-L) > > > mailing list > > > > To post a message email: JAVA400-L@midrange.com > > > > To subscribe, unsubscribe, or change list options, > > > > visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l > > > > or email: JAVA400-L-request@midrange.com > > > > Before posting, please take a moment to review the archives > > > > at http://archive.midrange.com/java400-l. > > > > > > > > > > > _______________________________________________ > > > This is the Java Programming on and around the iSeries / AS400 > (JAVA400-L) > > mailing list > > > To post a message email: JAVA400-L@midrange.com > > > To subscribe, unsubscribe, or change list options, > > > visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l > > > or email: JAVA400-L-request@midrange.com > > > Before posting, please take a moment to review the archives > > > at http://archive.midrange.com/java400-l. > > > > > > > > > > > > _______________________________________________ > > This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) > mailing list > > To post a message email: JAVA400-L@midrange.com > > To subscribe, unsubscribe, or change list options, > > visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l > > or email: JAVA400-L-request@midrange.com > > Before posting, please take a moment to review the archives > > at http://archive.midrange.com/java400-l. > > > > > > > _______________________________________________ > This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list > To post a message email: JAVA400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l > or email: JAVA400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/java400-l. >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.