Computer Science, asked by Harshi666, 1 year ago

What is a package? give an example {with reference to java}

Answers

Answered by webstar0
13
Package is a namespace that recognises is a set of related classes & interfaces.
java.applet & java.aet is example.

webstar0: r u understand
Harshi666: can we say package is a template of classes??
webstar0: no
webstar0: mistake yes hoga
webstar0: any confusion
snehaswain36: Thanks
Answered by nitish8089
5
package is a group or collection of class, interface, sub-package.

two type of package:

1.built-in-package.

in java-8 (14-built in package )

java.util (package)
java.lang(default-package)
java.io(package)

so... on 14 package provided by java you can go on jdk->src(folder) to see all built-in package in java...

2. user can also make itself package by using package keyword...


learn through hiearchy

package(top)
/ | \
class interface sub-package
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
all of these contain method.
Similar questions