mercredi 22 juillet 2015

Replace class with derived class using Java annotations

Say I extend a Java class like java.util.List to create a custom class called MyList... Is there any way if my peers write code using List, I can convert it into MyList during compilation/runtime?

i.e. If they have something like:

List groceryList = new List();

it should be working like:

MyList groceryList = new MyList();

I know annotations can do something of this sort. Is it possible to use them in this case? If yes, how?





Aucun commentaire:

Enregistrer un commentaire