Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
When you inherit a class from other class then by default the java compiler puts a call to the default construtor of ancestor class. However, if in the construtor of descendent class you call constructor of ancestor then java compiler doesn't call the default construtor of ancestor. Therefore, in your case call the non-default construtor of class A from both the constructor of class B and everything will be OK. Here is your example. } class B extends A { Replies: |
Sponsored Links
|