Sunday, 15 May 2011

Modify inbuilt Java functions -


Is it possible that the underlying functions of the Java function without modifying the files? For example, I want to modify the java.util.Arrays.toString () to throw an error when I use anything on the 1D array for convenience. Is this possible?

Sorry if it has been asked before, it could not be found on Google. Thank you.

No, you can not do this. I suggest you write your own category, provided you Want different functionality.

Obviously Java allows you to override the non-final example methods in the classes, but still need to know how to make an example of the customer subclass. ..and one method can accept that limiting the set of input is a subversion change anyway. And in view of this, this is a stable method in the first place ... Basically, the general mechanisms for custom behavior are not helping you.


No comments:

Post a Comment