– Group of similar types of classes, interfaces and subpackages.
💡1- Built in packages
– also called as predefined packages in java
i.e- java.lang, java.util, java.io etc
💡2- User defined packages
-also called as developer/user defined packages
[To use class of other package, we have 3 options to choose]
💡C- by importing full package*
Note– importing package doesn’t include subpackage
used to import only static member of a class instead of class.
Interview Questions —
- How packages are related to access modifiers?
- How many ways are available to import class of other packages?