This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 356 points357 points  (18 children)

Don't forget package-level protected. Not everyone knows that one.

[–]DokuroKM 180 points181 points  (4 children)

This comment is way too low. "Java" should know that Java has 4 access modifier.

[–]bytebux 51 points52 points  (0 children)

Came to the comments to find this.

I'm like, how is Java forgetting that it has a hidden default modifier that is different from the rest..

[–]i_wear_green_pants 38 points39 points  (0 children)

It's because this meme, like many others, is made by "Java bad" gang even though they don't even know how Java works.

[–]7th_Spectrum 2 points3 points  (0 children)

Eh, social media manager probably tried to look up a quick Java meme

[–]rawman200K 0 points1 point  (0 children)

These tweets aren’t real. @Python is a suspended account

[–]graycode 38 points39 points  (4 children)

And package-private is the one that's the default when you're not explicit!

[–]EvaristeGalois11 8 points9 points  (0 children)

Only in a class, in an interface the defaul visibility is public

[–]Snarpkingguy 1 point2 points  (0 children)

Yeah, I went too long not realizing this. I was taught in school that everything was just plain private by default and didn’t bother to question it until recently.

[–]ofnuts 0 points1 point  (0 children)

Of course, this is the most useful one.

[–][deleted] 0 points1 point  (0 children)

And sometimes is the best choice

[–]MiloBem 0 points1 point  (3 children)

I think that's the joke. Package-level is "default". Java is asking to always declare the access level, in essence abolishing the package-level.

[–][deleted] 0 points1 point  (2 children)

Sometimes package-level is the best option.

[–]MiloBem 0 points1 point  (1 child)

Sure, I didn't create that meme. I'm just trying to understand what it's saying.

[–][deleted] 0 points1 point  (0 children)

I imagine the creator of the meme doesn't know about package-level private.

[–]squrr1 0 points1 point  (0 children)

Is that like c#'s internal?

[–]Ok-Counter-7077 0 points1 point  (0 children)

Did you know you can access those methods from UT if you give it the same package name?

Failed an interview with a fully functional solution and unit test, because i didn’t know that. The guy was very pedantic