Packages
They are simple containers group the classes.
Two types-->
Userdefined(Written by developer) and build in (prewritten packages)packages.
Package name must be unique,lowercase.
EG: package.subpackage.anothersubpackage
import com.imdb.database.*;-->can use all the classes from this package.
Two classes with the same name .
import java.util.Date;
import java.sql.Date;
Dont use import all ,import only necessary class.
Comments
Post a Comment