heyy guys!!! #NO SPAMS#
what is package? explain it.
Answers
package-
(1) something, or a number of things, covered in paper or in a box.
(2)a number of things that must be bought or accepted together
please mark it as brainliest:)))
Short notes on Package:
(i) It is a collection of classes, interfaces and sub-packages.
(ii) In other words, all the common classes and interfaces must be placed in the package for getting advantages.
(iii) The concept of package makes us to understand data sharing can be possible within the program and across the programs between class to class, interface to interface and interface(s) to class.
Types of package:
(i) Pre-defined package/Built-in-packages ---- lang,awt,swing,util,sql etc.
(ii) User-defined/Custom-defined package.
Sample Program:
With the word package, we are used to create package.
package sample;
class Brainly
{
public static void main(String args[])
{
System.out.println("Welcome to brainly");
}
}
Advantages of package:
(i) Provides access protection.
(ii) Removes naming collision
(iii) Application performance can be increased.
(iv) Code Redundancy is reduced.
Disadvantages of package:
(i) Member passing is not possible.
Hope it helps!