i have an abstract class with an abstract method
i tried to had
we can't have some abstract method with the same name... java don't like that...
are there a way to do that?
Originally posted by marc weber:
The argument lists are different, so this should be fine. It works when I compile it. What error message are you getting?
Must not be adding to what he already has then. In total he has:
The first two are identical because Socket is a subtype of Object.
You could change the order of the parameters. You could use Object rather than Socket and simply check for a Socket via instanceof to delegate the functionality depending on type. You could remove the first two methods and have the third allow null for either the Socket or the Object and depending on which is null do what you would have done in the others. This kind of problem arising usually indicates a larger flaw in the design to me.
Originally posted by Ken Blair:
... The first two are identical because Socket is a subtype of Object...
One is "more specific" than the other, but they are not identical. This compiles fine for me with all three abstract methods in the same class. If you're getting an error, what error are you getting?
any comment are welcome...