Pattern: Public nested class
Issue: -
Nested classes are often used to implement functionality local to the class it is nested in. Therefore it should not be public to other parts of the code. Prefer keeping nested classes private
.
Example of incorrect code:
internal class NestedClassesVisibility {
public class NestedPublicClass // should not be public
}
Example of correct code:
internal class NestedClassesVisibility {
internal class NestedPublicClass
}