Question : Override a constructor

hi guys
Is it possible to override a constructor? How does  the java compiler behave if a super class's  constructor is overridden in sub-class?

thx

Answer : Override a constructor

you don't override a ctor, but any constructor in a subcl;ass needs to call a constructor in the super class. to do this we use super()

eg.

public class A {

   public void A(int x) {
      .....


public class B extends A {

   public void B(int x) {
      super(x);
      .....

   public void B(int x, int y) {
      super(x);
      .....
Random Solutions  
 
programming4us programming4us