InterviewSolution
Saved Bookmarks
| 1. |
Advantages of Packages in Java |
|
Answer» A package in Java is a group of different sub-packages, interfaces, classes etc. that are of a similar type. The two types of packages are build-in packages and user defined packages. Some of the build-in packages are awt, swing, lang, util. javax, SQL etc. Some of the advantages of packages in Java are given as follows:
A PROGRAM that demonstrates a package in Java is given as follows: package packageExample; public class Demo { public static VOID main(String args[]) { System.out.println("This is a package example"); } }The OUTPUT of the above program is as follows: This is a package example |
|