Consider this example :
import java.lang.reflect.Field;
public class Test {
public static void main(String[] args) {
C c = new C();
try
Yes it's not nice but it does allow frameworks such as Java Serialization to work.
Setting the accessible flag in a reflected object permits sophisticated applications with sufficient privilege, such as Java Object Serialization or other persistence mechanisms, to manipulate objects in a manner that would normally be prohibited.
I beleive that the functionality can be disabled through the SecurityManager
http://javabeans.asia/2008/10/12/how_to_set_securitymanager_and_java_security_policy_programmatically.html