java - Why are modifiers allowed for a package when they don't seem to do anything? -


I can declare the following package with modifier but it does not show any effect on anything:

  Private public protected static final package com.stackoverflow.mangodrunk // ... whatever whatever {// ...}  

So my question is, A modifier adds anything before the package annotation and why it will be allowed by the compiler?

Update : There seems to be a problem with the compiler bundled with Eclipse because others have mentioned that it is a compiler error using Sun's JDK is.

They are not what compiler are you using?

$ javac com / stackoverflow / mangodrunk / whatever.java com / stackoverflow / mangodrunk / whatever.java: 1: class, interface, or enum required private public protected static final package com.stackoverflow Mangodrunk; ^ 1 error

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -