This document discusses Java packages. It defines a package as a group of similar classes, interfaces, and sub-packages. Packages provide organization and access protection. There are built-in Java packages like java, lang, awt, and user-defined packages created using the package keyword. Some key built-in packages discussed are java, lang, awt, javax, swing, net, io, util, sql. Common methods from core classes like java.lang and Math are also explained.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
38 views1 page
9 Understanding Core Packages
This document discusses Java packages. It defines a package as a group of similar classes, interfaces, and sub-packages. Packages provide organization and access protection. There are built-in Java packages like java, lang, awt, and user-defined packages created using the package keyword. Some key built-in packages discussed are java, lang, awt, javax, swing, net, io, util, sql. Common methods from core classes like java.lang and Math are also explained.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
1. Define package in java. Write its importance. Explain the use of java package.
A java package is a group of similar types of classes, interfaces and sub-
packages.Package in java can be categorized in two form, built-in package and user- defined package.There are many built-in packages such as java, lang, awt, javax, swing, net, io, util, sql etc. Here, we will have the detailed learning of creating and using user-defined packages.
Advantage of Java Package
1) Java package is used to categorize the classes and interfaces so that they can be easily maintained. 2) Java package provides access protection. 3) Java package removes naming collision
The package keyword is used to create a package in java.
1. //save as Simple.java 2. package mypack; 3. public class Simple{ 4. public static void main(String args[]){ 5. System.out.println("Welcome to package"); 6. } 7. } 2. Explain the types of java Packages. 3. Explain any 5 built in packages used in java. 4. Explain Wrapper classes and associated method. 5. Write some of the method of java.lang,Math class. 6. Explain some of core classes. (vector , Stack , Dictionary hash table , Enumerations, Random)