how do we tell java that we want to use a particular package in a file
Answers
Answered by
9
Answer:
A Package is a collection of related classes. It helps organize your classes into a folder structure and make it easy to locate and use them. More importantly, it helps improve re-usability. Each package in Java has its unique name and organizes its classes and interfaces into a separate namespace, or name group.
Answered by
5
By using the "import" keyword we used the package in the java programming language.
Explanation:
- The package is the collection of functions and the class in the java programming language. The main advantage of the package provides the reusability feature in the programming language.
- In the predefined Package, the meaning of function and class is already defined only we used that package and uses that function in a very simple manner For example the Scanner class is defined in the java. util package.
- However, we also create there own package The advantage of creating there own package has used this package in multiple programs if required .to create any package used the syntax package package_name;
- we used the import keyword for using any package in java.
For example :
import java.util.*;
Learn More :
https://brainly.in/question/8351321
Similar questions