commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ortwin Gl├╝ck" <ortwin.glu...@nose.ch>
Subject Re: [httpclient][patch] StatusLine encapsulation
Date Wed, 04 Sep 2002 14:19:20 GMT
Believe it or not but run the following code:

public class Super {

     public Super() {
         System.out.println("Super()");
     }
}

---

public class Test extends Super {

     public Test(int a) {
         System.out.println("Test(int)");
     }

     public static void main(String[] args) {
         Test test1 = new Test(3);
     }
}

The output is:

Super()
Test(int)

So super() is definitely called implicitely from Test(int). This is even 
the case if Super is declared abstract. It is also the reason why you 
can not declare a superclass' no-arg constructor as private.

This is just to clarify things

Odi

Ryan Lubke wrote:
> My point was that I don't believe super() will be added to all
> constructors by default as Ortwin seemed to imply.


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message