Overwriting a declared method?
Hello, I'm messing with something Java based, I want to modify it a bit. My code is simply this:
Now the issue is that unlike the Field class, Method doesn't seem to have a
set
method. So, if I wanted to override this function - how?6 Replies
⌛
This post has been reserved for your question.
Hey @Lort533! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Hi, what do you mean by "override this function"?
The field has a "set" method, because it allows you to set the value of the field.
you dont just "set" a method. you need to generate a new class that overrides that method, and then you need to load that class and call its a() method
really depends on what you want to do here
do you want to:
1. change the a() method for everyone globally retroactively?
2. make one instance of XYZ with a different a() implementation?
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
happened to solve it already, but it turned out there is only one instance of that class so I did the latter of what you've mentioned, I originally thought I need to override the method for all existing instances of the class
Post Closed
This post has been closed by <@236915391933317120>.