[4592] in java-interest
Re: calling non-default constructor for derived classes?
daemon@ATHENA.MIT.EDU (Sami Shaio)
Mon Jan 8 15:47:37 1996
Date: Mon, 8 Jan 1996 11:04:22 -0800
From: Sami.Shaio@Eng.Sun.COM (Sami Shaio)
To: java-interest@java.Eng.Sun.COM, brian@jjt.com
Just do:
NewClass(int whatever) {
super(whatever); // calls the superclass constructor
}
Note that in Java you can also call another constructor in the same
class by calling this(...).
--sami
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com