Ben Stumpf
Ben Stumpf

Reputation: 23

Scope of public method in private class in java - no package

I have encapsulated variables in a private data class inside of a public data structure, if I have a public method in the private class, what can access that method?

If I have a class that can access the private object through a get method in the public class can the first object access the public get or set method in the private class?

If you need any other information please let me know.

Upvotes: 0

Views: 447

Answers (1)

Lew Bloch
Lew Bloch

Reputation: 3433

Anything with access to the private member type will have access to its public members in turn.

Upvotes: 1

Related Questions