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

php - multilevel menu with multilevel array -

.net - C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL -

objective c - iPhone and it's wireless area -