Computer Science, asked by divya886, 1 year ago

heyy guys!!! #NO SPAMS#

what is package? explain it.​


siddhartharao77: is it a java Question? (or) Database question?
divya886: java
divya886: question
tanushree88: oh

Answers

Answered by srushti1612
4

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:)))

Answered by siddhartharao77
10

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!


Topperworm: Excellent answer my dear
siddhartharao77: Thank you sooo much dear
Anonymous: Great Answer! :)
siddhartharao77: Thank you so much sejal
Similar questions