A visibility modifier exists in an inappropriate context. This can occur when applying a modifier to an expression that cannot take the modifier or when using a modifier for a member of a class or interface that already has an incompatible modifier.
To correct this error
-
Remove the visibility modifier or use an alternative modifier.
-
Make sure that visibility modifiers applied to class members match the visibility of the class.