#Meme explanation curious to know what's up with it
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Meme explanation curious to know what's up with it
There's no getter, and joke is private
literally you can't get it
the method doesn't act as a constructor, that's how a setter works
the difference is
in a constructor you give the value in creation
in a setter you change the current value (no constructor, so default for objects is null)
We divide modifiers into two groups:
Access Modifiers - controls the access level
Non-Access Modifiers - do not control access level, but provides other functionality
So public code is accessible for all classes.
But private code is only accessible within the declared class.
So the private attribute Joke can't access directly.
In this case, we use setter and getter.
@autumn panther Not sure if you understood it, but that is the answer to your question.
The subtitle says "You wouldn't get it", which is funny because there's no way for you to get the joke instance from the object.
You would be able to set it, but not to get it.
the joke is private class so you can't get it simply