Why we use package in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why we use package in java?

14th Jul 2017, 2:18 AM
MANOJ KUMAR
MANOJ KUMAR - avatar
2 Answers
+ 1
A java package is a group of similar types of classes, interfaces and sub-packages.Such as io package contains buffered reader class which is used to input data from the user , math for different mathematical functions. Even u can make a package that contains classes of programs u need most which will save your time.
14th Jul 2017, 3:11 AM
Nirmal Kumar Bhakat
Nirmal Kumar Bhakat - avatar
+ 1
Java packages are not only used to organize and group your code, but also to help prevent naming collisions in the same way a namespace does in other languages such as C++ and C#.
14th Jul 2017, 3:35 AM
ChaoticDawg
ChaoticDawg - avatar