You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a package is a group/dir of similar types of classes, interfaces and sub-packages
some packages in java
- java.lang: used to bundle the fundamental classes NO IMPORT REQUIRED
- java.io: used for the classes for input, output functions which are bundled in
this package
Two Types Of Packages:
- Built-in package already available in java language
- the programmer can create their own package which
can be imported to other classes
Important Concepts with Access Modifiers in Regards to Packages
1- A Private class's methods/functions are not accessible to any other class
within the same package nor to any other package
2- A public class's method/function is accessible to any other class within
the same package and to any outside packages
3- A Protected class's method/function is accessible within the same package
to any other class but not to another class within another package
4- Default access modifier's methods/functions are accessible to any other
class within the same package but not to any other class defined in another
package