Article View: borland.public.jbuilder.java.language
Article #16915Help needed about constructors
From: Jean-Christian Gagné
Date: Mon, 04 Jan 1999 00:00
Date: Mon, 04 Jan 1999 00:00
30 lines
919 bytes
919 bytes
Hi,
If a class defines a constructor, does a subclasse inherits this
constructor ?
For example :
public abstract class Parent {
public Parent(String s) {...}
}
public class Child extends Parent {
public Child(int i) {...}
}
Can I write
Child c = new Child(myString);
without declaring the corresponding constructor in Child ?
Thanks
JCG
Technical Details
Message-ID:
<36907F36.29702A5F@vtx.ch>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,817ee5543e3b83d,start X-Google-Attributes: gidf74b3,public From: Jean-Christian Gagné <jcgagne@vtx.ch> Subject: Help needed about constructors Date: 1999/01/04 Message-ID: <36907F36.29702A5F@vtx.ch> X-Deja-AN: 428571794 Content-Transfer-Encoding: 7bit X-Accept-Language: fr Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language