Grokking Java Interview Questions
Vote

0% completed

​

Access Modifiers and Packages

ModifierSame classSame packageSubclass in another packageAny other class
privateYesNoNoNo
noneYesYesNoNo
protectedYesYesYes, with a conditionNo
publicYesYesYesYes

This table summarizes who can use a field, a method, or a constructor of a public class. Three of its cells need an explanation: the "No" for a subclass in the second row, the condition in the third row, and the "Yes" at the end.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content