I have a Java class similar to the following one:
public final class Node {
public Node() {}
}
I have learned already how to change change the accessibility of 'final' fields via the reflection API, but is this also possible for classes? Can I turn a final class into a non-final class at runtime?
You can re-write a class file using a library like ASM.
There may be no point changing the final
status of a class at runtime as it needs to be non-final at compile time to compile a sub-class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With