Created
July 16, 2021 15:49
-
-
Save hgfernan/b66bf15c14ec780db9400b68d6242896 to your computer and use it in GitHub Desktop.
Invalid Java code showing a class accessing the private member of another class in the same package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
*/ | |
package tPrivateProtected; | |
/** | |
* @author hilton | |
* | |
*/ | |
public class IndependentProtectedClass { | |
protected int protectedMember; | |
protected IndependentProtectedClass() { | |
protectedMember = 1; | |
} | |
protected int sum(IndependentPrivateClass ipec) { | |
return protectedMember + ipec.privateMember; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment