Alex Rivera | Logout

What does super() method do?

Asked 2011-05-25T01:01:20.000
23

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?

Edit
Report

1 Answer

2

There is no such thing as "superclass context" the context is an interface to access information from the application environment like image resources, system services ect. The context will be from whatever you pass in and is class independent. For instance, an Activity is the implementation of the Context interface you are likely to be using and any view you make from within that activity will have the same Context which is actually that provided by the activity.

answered 2011-05-25T01:22:08.230

Your Answer