Re: Forcing sub-classes to implement Constructor

Jeff Kesselman <[email protected]>
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <[email protected]>
Jeff Kesselman wrote:
> Victor Grazi wrote:
>> No I said "only a non-default constructor"
>>
>> -----Original Message-----
>>
>> From:  Randall R Schulz <[email protected]>
>> Subj:  Re: [ADVANCED-JAVA] Forcing sub-classes to implement Constructor
>> Date:  Thu Aug 9, 2007 7:10 pm
>> Size:  1K
>> To:  [email protected]
>>
>> On Thursday 09 August 2007 15:21, Victor Grazi wrote:
>>
>>> No but if you have only a non default constructor then subclasses are
>>> forced to implement it.
>>>
> Actually I don't think thats true.
>
> I *think* this is legal... though i haven't checked:
So I goofed obviously, the should have been...

public class Foo {
  public Foo(String str){

 }
}

public class Bar extends Foo {
   public Bar() {
      super("dummy");
  }
}

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.