twc
Posts: 129
Nickname: twc
Registered: Feb, 2004
|
|
Re: 'cannot resolve symbol' - why?
|
Posted: Apr 7, 2004 11:15 AM
|
|
> I knew that a class always has a constructor without > arguments, even if it is the empty (default) one.
No, this is not true all of the time.
If you do not create any constructors, then the compiler will create a no-argument constructor that only calls the no-argument constructor of the superclass. If you do not specify a superclass, then Object becomes the superclass.
But if you create any constructors, then the compiler does not create one for you.
If you fail to call a constructor of your superclass, then the compiler will call a no-argument constructor. This might be what your problem is. You need to explicitly call one of the constructors of the PrintStream class, and all of those require at least one argument.
> Is it possible to completely eliminate this constructor, > keeping only one (or more) with arguments, or what I knew > in the first place was wrong?
Obviously, you are NOT required to have a no-argument constructor. Your superclass does not have one. I see no reason to create one.
|
|