how to restrict protected method access to only subclasses
<p>How can we restrict access of any protected method to only subclass in any package not to the class in the same package.</p>

<p>If any class that is not the subclass and in same package also it must throw exception like "Protected method."</p>

<p>Edit : Is there any way to check calling class name instance and then we can verify using <strong>instanceof</strong> .</p>
