dimanche 4 mars 2018

How can i remove final modifier from a method

Using java reflection we can change fields as i know. But i couldn't find any info about removing final modifier in methods with reflection.So my problem is

public abstract class Ok {
public  final boolean isOk() {
    return false;
}
}

I need to change isOk method return value to true.

   public static Ok gandalf() throws Throwable {
       //i need to change isOk method here.
}





Aucun commentaire:

Enregistrer un commentaire