samedi 19 janvier 2019

Differentiate provided default no args constructor from declared one

Simple question: How can I differentiate a default constructor. i.e:

class AClass { } // will have a default no args constructor -> public AClass() {}

from one specified like:

class AClass {
    private final int i;

    public AClass() { i = 0; }
}

Checking the options reflection libraries provide I am not able to find any that allows me to distinguish one from another...

I've tried mostly with the methods provided by Class#get*Constructor(s)

Maybe I got tunnel vision, and I am forgetting something or there is another approach to this I am missing... any help would be appreciated!





Aucun commentaire:

Enregistrer un commentaire