| Author |
What happens when you want to extend to 2 different classes
|
Andrew Cleland
Greenhorn
Joined: Apr 13, 2005
Posts: 4
|
|
I am quite new to Java, and have been constructing a servlet, which works until I add some new functionality. This new functionality just so happens to be a bunch of code I have copied from somewhere else. The copied code works fine in its own context. But the problem I have is that my servlet extends HttpServlet, and the copied code has a method from a different class, which was implemented in the original source as extends x. The problem being that I can't extend 2 different classes, what is the way to tackle this problem? Andrew
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
You could create an instance of x and call its appropriate methods.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Andrew Cleland
Greenhorn
Joined: Apr 13, 2005
Posts: 4
|
|
Paul, I was in the process of composing another message saying I did not understand what you meant, when I looked at the code again, and figured out what to do, from your suggestion. It now works. Thank you. Andrew
|
 |
 |
|
|
subject: What happens when you want to extend to 2 different classes
|
|
|