Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does super() do here [closed]

Tags:

java

android

I was going through a piece of code in an android Malware to understand its working. av class was defined as below

public final class av implements android.widget.AdapterView.OnItemClickListener {
    final ChooserActivity a;
    public av(ChooserActivity chooseractivity) {
        super();
        a = chooseractivity;
    }
    ...Other methods here
}

super() invokes the immediate parent class constructor -> this I know

Parent class is Object. So the constructor will return what. Meaning what will be the properties of returned object.?

like image 714
Nik theGeeK Avatar asked Jun 17 '26 14:06

Nik theGeeK


1 Answers

super() must be in the first statement inside the subclass constructor,it calls the parent constructor

public av(ChooserActivity chooseractivity)
{
    super();
    a = chooseractivity;

}
like image 57
Nambi Avatar answered Jun 19 '26 02:06

Nambi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!