Email address:
Password:
SCJP/OCPJP 1.6 certification
Practice Exams and Training
SCJP Online Training » Discussions

Why is "protected and final" for top-level classes not possible?

Answer B) As I understand, "public and final" is possible but not "protected and final" for top-level classes. This would only bring some restrictions in accessibility to classes from other packages.


Regards, Carlos



Hi Carlos,


It's not "protected and final" which is not allowed - you're not allowed to use protected anyway on a top-level class. As for example, the following code doesn't work:


protected class SomeName {
}


ExamLab © 2008 - 2024