Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@LastDigitOfPi
Yeah it doesn't call itself. It gets called by quite a few other methods.
The only thing that this method does is that it changes the method of the subclass to public.
So that for instances of the subclass this method can be called from classes outside of the package. -
th4t6566yI think JVM will check the code inside the method that is about to overwrite and seen that the instruction inside it is going to make sense JVM will execute the related parent method.
But never tried this :) -
taglia5716y@jespersh technically, you can't call s private method of a class, even if it is the superclass.
You can change the visibility from "protected" to public though..
Related Rants
First of all sorry for the bad picture. Let's move on...
Deleting this method like:
Who the hell did this nonsense?
I just took a picture of it so I could post it here and rant about it.
Sure felt stupid after deleting it for not thinking about a protected method in the parent class that is part of an API.
So... Yeah....
I was feeling too confident in my skills lately anyway
rant
protected
public
i'm dumb sometimes