Default Access (package access) confusion
Hi eveybody,
I am new to java and as I was reading, I came accross the default access modifier i.e. package level access modifier which is used to restrict only the classes in the same package to access the class.
I've understood the concept and how it is applied technically but I am not able to figure out in which situations package level access would fit in. Can someone help me giving a short scenario or a practical example where package level access can be used.
thanks
Re: Default Access (package access) confusion
Hello, I've been working as a Java Developer for a number of years now and I can tell you I've never used the package level (default access modifier) on purpose at any time.....yet.
The purpose of this modifier is of course if you have a case where you want to have support classes which are not static inner classes but you would like these to be protected and only used by one or several main classes in your package.
// Json