It throws IllegalAccessException at line (2).
It throws SecurityException at line (2).
JVM will refuse to run TestCreditCard as it uses CreditCard and
it should be recompiled to use newer version of CreditCard.
It throws ClassNotFoundException at line (1).
It prints account number in spite of private specifier.
The behavior of JVM is not specified for such cases, it depends on implementation.
|