P
Philipp Leitner
hi all,
this may be a silly question, but is there actually any way to
_overwrite_ a constructor of a superclass in Java?
I have the following inheritance structure:
"ProfileAdmin" inherits from "ProfileSearcher"
both classes are almost identical, the main difference is that the
constructor of ProfileSearcher throws an exception in certain
circumstances, while ProfileAdmin should try to repair the problem in
these cases (with the reason that ProfileSearcher should be used on thin
clients, which are not capable of the cpu-heavy repair actions).
My first idea would have been to just overwrite the constructor of
ProfileSearcher, but I quickly discovered that javac inserts an implicit
"super()" at the beginning of the subclasses' constructor (I really had
no clue about that in advance ...) :-(
Any tips on how to solve this issue in a clean way?
thx in advance,
Philipp
--
Philipp Wolfgang Leitner, Bakk.rer.soc.oec.
0225511
Vienna University of Technology
"Ask five economists and you'll get five different explanations (six if
one went to Harvard).
-- Edgar R. Fiedler"
this may be a silly question, but is there actually any way to
_overwrite_ a constructor of a superclass in Java?
I have the following inheritance structure:
"ProfileAdmin" inherits from "ProfileSearcher"
both classes are almost identical, the main difference is that the
constructor of ProfileSearcher throws an exception in certain
circumstances, while ProfileAdmin should try to repair the problem in
these cases (with the reason that ProfileSearcher should be used on thin
clients, which are not capable of the cpu-heavy repair actions).
My first idea would have been to just overwrite the constructor of
ProfileSearcher, but I quickly discovered that javac inserts an implicit
"super()" at the beginning of the subclasses' constructor (I really had
no clue about that in advance ...) :-(
Any tips on how to solve this issue in a clean way?
thx in advance,
Philipp
--
Philipp Wolfgang Leitner, Bakk.rer.soc.oec.
0225511
Vienna University of Technology
"Ask five economists and you'll get five different explanations (six if
one went to Harvard).
-- Edgar R. Fiedler"