What does super() method do?

mergesort picture mergesort · May 25, 2011 · Viewed 34.6k times · Source

What does the super method do?

public DataFetch(Context context) {
    super();
    this.ctx = context;
}

Does this constructor make the context of the newly created object the context of the super class? Not 100% sure how this works. So would the super() method essentially just be saying "put me into super class mode" to say it in lay man's terms?

Answer

duffymo picture duffymo · May 25, 2011

It says "initialize my parent class before you initialize me" by calling its default constructor.