vendredi 29 septembre 2017

Calling the appropriate constructor for given arguments

Suppose the arguments given in the String array are:

String [] args = {"ABC","5", "4.4","true"};

Now I want to call the constructor that takes a String, integer, double and Boolean respectively by calling the method class.getConstructor(args).

How will I do this?





Aucun commentaire:

Enregistrer un commentaire